How to prevent Gravity Forms entries from being stored
Gravity Forms does not have a built-in switch that prevents an entry being created immediately. You can delete entries after processing with a hook, use the built-in retention policy for delayed cleanup, or use Gravity Perks Disable Entry Creation for immediate deletion after feeds run.
- 01Choose when deletion should happen
- 02Set a retention policy
- 03Add deletion code manually
- 04Check feeds and uploads
- 05Test the failure cases
- 06Use the fast route
What you need
- Gravity Forms installed and active
- Administrator access to WordPress
- A backup or staging copy if you are adding custom PHP
- The form ID you want to target
Choose when deletion should happen
Gravity Forms needs to create an entry so it can process notifications and add-on feeds. The practical choice is between delayed cleanup and deletion immediately after processing.
Use the built-in retention policy if keeping an entry for at least one day is acceptable. Use custom code or an add-on if the entry must disappear during the submission process.
Set a retention policy
For delayed deletion, open the form in the WordPress dashboard and go to Settings then Personal Data. Under Retention Policy, choose whether entries should be moved to the trash or permanently deleted, then set the number of days and save.
The minimum is one day, and cleanup runs through a daily WordPress cron task. This also applies to partial Save & Continue submissions. It is a good manual route when a short retention period is acceptable, but it is not immediate and an entry may remain for up to about 24 hours after it becomes eligible.
Add deletion code manually
For immediate cleanup without another plugin, add the following to a custom functionality plugin, a snippets plugin, or the active theme’s functions.php. Replace 1 with the form ID, or use the unsuffixed action if it should apply to every form.
add_action( 'gform_after_submission_1', 'remove_form_entry' ); function remove_form_entry( $entry ) { GFAPI::delete_entry( $entry['id'] ); }
This waits until the entry has been recorded and the normal submission hook runs, then deletes it. The drawback is that it is your responsibility to maintain the code and check that every integration has finished before deletion.
Check feeds and uploads
Submit a test entry and confirm that notifications, CRM feeds, webhooks, user registration, and any file handling complete before the entry disappears. Deleting an entry can also remove associated uploaded files, so do not use this approach if those files still need to be available unless you deliberately change the file-deletion behaviour.
Be especially careful with asynchronous feeds. A background feed may run after the submission request, so deleting the entry immediately can leave that integration without the data it needs. Disable asynchronous processing for the affected feed or delay deletion when the integration requires it.
Test the failure cases
Test a successful submission, a notification failure, an integration failure, a file upload, and any User Registration workflow. Check the Gravity Forms entry list, the receiving service, email delivery logs, and the uploaded-files location.
Do not assume that an empty entry list proves the form works. If an integration needs to read the entry later, immediate deletion may cause it to fail even though the form confirmation still appears. Keep the retention policy enabled instead when you need a recovery window.
Use the fast route
Install and activate Gravity Perks Disable Entry Creation, open the target form, go to Settings, scroll to the Entry Creation section, and enable Disable entry creation. Save the form settings.
The perk lets Gravity Forms process the submission first and then removes the entry and associated files. It also supports conditional logic, which is useful when only some submissions should be deleted. Check your add-ons for asynchronous processing before going live.
Let Gravity Perks Disable Entry Creation do it
Stops or conditionally deletes entries after processing, ideal when notifications or integrations need the form but database retention is unwanted.
Sources
- docs.gravityforms.com /delete-entry-data-after-submission/?utm_source=openai
- docs.gravityforms.com /how-to-automatically-delete-gravity-forms-entries/?utm_sour…
- docs.gravityforms.com /troubleshooting-notifications/?utm_source=openai
- gravitywiz.com /documentation/gravity-forms-disable-entry-creation/?utm_sou…
Questions
- Can Gravity Forms stop creating the entry before submission processing?
- No. Gravity Forms creates the entry so notifications and add-on feeds can process the submitted data. The normal solutions delete it after processing, either through the built-in retention policy, custom code, or an add-on. A product such as Gravity Perks Disable Entry Creation changes the result, not the underlying processing order.
- Is the built-in retention policy enough?
- Yes, if you can keep entries for at least one day. Go to the form’s Personal Data settings and choose trashing or permanent deletion. Cleanup runs during a daily cron task, so it is suitable for routine data minimisation but not for a form that must leave no entry immediately after submission.
- Will deleting an entry delete uploaded files too?
- Usually, yes. Gravity Forms documentation states that associated file uploads are removed when the entry is deleted. If the files must remain, configure the relevant file-deletion filter or store the files separately before deletion. Test this with a non-sensitive upload before enabling automatic cleanup on a live form.
- Why did an integration stop working after entries were deleted?
- The integration may be asynchronous and may run after the submission request has finished. If the entry is deleted first, the background process may no longer be able to read it. Disable asynchronous processing for that feed where supported, delay deletion, or use the retention policy until the integration has completed reliably.