Docs & Support

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

frm_auto_delete_entries_batch_size

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_auto_delete_entries_batch_size filter to change how many entries are deleted each time the automatic entry cleanup runs. This cleanup removes entries older than the number of days set in Automatically delete entries after, on the GDPR tab of a form's settings.

The cleanup runs every hour and deletes up to 200 entries per run. Anything left over is deleted on the next run.

Requirements

  • Formidable Forms Pro 7.0 or later.
  • Enable GDPR related features and enhancements turned on in Formidable → Global Settings → General Settings. Nothing is deleted while it's off.
  • Automatically delete entries after turned on for at least one form.

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

Usage

add_filter( 'frm_auto_delete_entries_batch_size', 'my_auto_delete_entries_batch_size' );

Parameters

  • $batch_size (int): The maximum number of entries to delete in one run, across all forms. Default 200.

How the batch is shared

The batch is shared between every form with automatic deletion turned on. This way, one form with a large backlog can't hold up the others. Each form gets an equal share, and any share a form doesn't use carries over to the forms after it.

The oldest entries in each form are deleted first.

The limit counts entries only. These items are removed with each entry and don't count toward the batch:

  • The entry's repeater entries.
  • A post created from the entry. Posts and pages go to the trash, and other post types are deleted permanently.
  • Uploaded files, when the file upload field is set to delete files with the entry.

Examples

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

Delete more entries per run

This example raises the limit to 1,000 entries per run. Use it to clear a large backlog faster after you first turn on automatic deletion. A larger batch takes longer to run.

add_filter( 'frm_auto_delete_entries_batch_size', 'my_auto_delete_entries_batch_size' );
function my_auto_delete_entries_batch_size( $batch_size ) {
	return 1000;
}

Pause automatic deletion

Returning 0 stops the cleanup from deleting anything, without changing each form's settings. Remove the code to start deleting again.

add_filter( 'frm_auto_delete_entries_batch_size', '__return_zero' );

Limitations

  • The cleanup runs on WordPress cron, which runs when someone visits your site. On a site with little traffic, runs can happen less often than every hour.
  • Deleted entries can't be restored.
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