My site got hacked and I have 1.5 million form entries. How do I delete them all. If I select them all and send them to the trash, my site crashes. Do I need to do it in phpmyadmin?
Hi Shawn. Trying to do that many in the wp-admin will kill the site. You can use WP CLI with the Gravity Forms CLI Add-On to delete them in batches, or yes, you can use phpMyAdmin.
You need this add-on:
And the functionality of the Gravity Forms cli add-on is explained here:
Thank you so much! Do you mind if I ask how to do it with phpMyAdmin? I’m not familiar with WP-CLI and will probably do more harm than good.
Hi Shawn, First, make a database backup, in case something goes wrong.
Now, what criteria will you use to search and find these 1.5 million entries? Is there a specific time or data, IP address, content in the entry, etc? Are all the bad entries between entry ID 11111 and 1512000 or something like that?
I checked and actually all the entries can be deleted. Hopefully that makes it easy.
Thanks!!
HI Shawn. So you will be removing all entries, but keeping all your forms and feed settings in place?
Yup. I’d like to keep the form, just removing all entries.
Thanks,
Shawn
Hi Shawn. To delete all entry records from your WordPress database, you can run this SQL in phpMyAdmin:
TRUNCATE TABLE wp_gf_entry;
TRUNCATE TABLE wp_gf_entry_meta;
TRUNCATE TABLE wp_gf_entry_notes;
TRUNCATE will delete all records in each of those tables. If your database table prefix is not wp_
, update that to match yours.
As always, make a database backup first before running any SQL commands directly.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.