Docs & Support

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

frm_spam_retention_summary

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_spam_retention_summary filter to change the spam cleanup period shown in a form's settings. It only changes what's shown there. To change when spam entries are deleted, use frm_spam_retention_days.

Formidable Forms Pro uses this filter to show the saved Delete spam entries automatically setting.

Requirements

  • Formidable Forms 7.0 or later, with Formidable Forms Pro 7.0 or later active.

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

Where it appears

Open a form and go to Settings → Spam. Under Global Spam Settings, the Delete spam entries automatically row shows the period, such as "(after 30 days)". When the filter returns 0, the row shows the setting as off.

The row shows a period only when Formidable Forms Pro is active.

Usage

add_filter( 'frm_spam_retention_summary', 'my_function_name', 20 );

Parameters

  • $retention_days (int): The number of days shown. Formidable Forms Pro sets it to the saved setting. 0 shows cleanup as off.

Examples

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

Show a custom cleanup period

This example deletes spam entries after 14 days and shows that period in each form's Spam settings. Priority 20 runs it after Formidable Forms Pro's own filter.

add_filter( 'frm_spam_retention_days', 'my_frm_spam_retention', 20 );
add_filter( 'frm_spam_retention_summary', 'my_frm_spam_retention', 20 );
function my_frm_spam_retention( $days ) {
	return 14; // Keep spam entries for 14 days.
}

Limitations

  • The Delete spam entries automatically setting in Formidable → Global Settings → Captcha/Spam still shows the saved choice. This filter doesn't change 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