Docs & Support

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

frm_entry_marked_spam

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_entry_marked_spam action to run code after someone marks an entry as spam from the back end. When it runs, the entry and its child entries, such as repeater rows, already have the spam status.

Marking an entry as spam moves it to the Spam tab and hides it from Views and other entry lists. Form actions that already ran aren't reversed.

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.

When it fires

The action runs when a user clicks Mark as spam for a submitted entry, in the entries list or on the entry's page. Only users who can delete entries see that option.

It doesn't run for submissions that a spam check saved as spam entries. Those entries are created with the spam status.

Usage

add_action( 'frm_entry_marked_spam', 'my_function_name' );

Parameters

  • $entry_id (int): The ID of the entry that was marked as spam.

Examples

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

Email the site admin when an entry is marked as spam

This example emails the site admin with the name of the user who marked the entry and the entry ID.

add_action( 'frm_entry_marked_spam', 'my_frm_notify_marked_spam' );
function my_frm_notify_marked_spam( $entry_id ) {
	$user = wp_get_current_user();
	wp_mail(
		get_option( 'admin_email' ),
		'Entry marked as spam',
		sprintf( '%s marked entry %d as spam.', $user->display_name, $entry_id )
	);
}

Limitations

  • Mark as spam appears only for submitted entries. Draft entries don't show it.
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