Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

frm_save_spam_entry

Heads up! This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or third-party development.

Use the frm_save_spam_entry filter to choose whether a submission flagged by a spam check is saved as a spam entry or rejected. It overrides the choice set for that check in the spam check settings.

A saved spam entry goes to the Spam tab of the entries list. The visitor sees the normal success message. A rejected submission isn't saved. The visitor sees the spam error.

Requirements

  • Formidable Forms 7.0 or later. The hook is part of Formidable Forms Lite.

Formidable Forms makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.

How it works

Each spam check is set to Save as a spam entry or Reject with an error message in Formidable → Global Settings → Captcha/Spam. The choices are under Customize how spam submissions are handled. When a check flags a new submission, Formidable passes that choice through this filter.

Learn more about spam checks.

The built-in spam checks run the filter only for new submissions. When an entry is being edited, a submission that fails one of them is always rejected. A custom check runs the filter whenever its code calls FrmSpamEntriesHelper::maybe_flag_submission().

For the CAPTCHA errors check, Formidable also runs the filter when it shows a form with a CAPTCHA field.

Usage

add_filter( 'frm_save_spam_entry', 'my_function_name', 10, 2 );

Parameters

  • $should_save (bool): true when the check is set to save flagged submissions as spam entries. Return false to reject the submission.
  • $source (string): The key of the spam check that flagged the submission. The built-in keys are listed below. A check added with the frm_spam_entry_sources filter uses its own key.
Source keySpam check
captchaCAPTCHA errors
honeypotHoneypot
antispamJavaScript anti-spam check
no_ipMissing IP address
akismetAkismet spam
akismet_discardAkismet blatant spam
denylistDenylist
wp_disallowed_wordsWordPress disallowed words
wp_commentsWordPress spam comments
stopforumspamStopForumSpam

Examples

Learn where to put the code when adding a custom PHP function to your site.

Always reject bot submissions

This example always rejects submissions flagged by Honeypot or the JavaScript anti-spam check, whatever the settings say. Bot submissions stay out of the Spam tab.

add_filter( 'frm_save_spam_entry', 'my_frm_reject_bot_spam', 10, 2 );
function my_frm_reject_bot_spam( $should_save, $source ) {
	if ( in_array( $source, array( 'honeypot', 'antispam' ), true ) ) {
		return false;
	}
	return $should_save;
}

Save every flagged submission on a staging site

This example saves every flagged submission as a spam entry on a site whose environment type is staging. It helps when you test spam checks and want to review each flagged submission.

add_filter( 'frm_save_spam_entry', 'my_frm_save_spam_on_staging', 10, 2 );
function my_frm_save_spam_on_staging( $should_save, $source ) {
	if ( 'staging' === wp_get_environment_type() ) {
		return true;
	}
	return $should_save;
}

Limitations

  • When an active add-on needs an update to support spam entries, flagged submissions are rejected and this filter doesn't run. The Captcha/Spam settings show which add-on to update.
Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2026 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Complete your purchase
    Don't forget your purchase!
    Complete Purchase
    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms