2

I have a client using Freeform (free) 4.2 that has about 30K of submissions between two forms. They have no need to save these and I'd like to clear them out or better yet set them up to do it. I see no "delete all" in the Freeform CP so assume my options are either duplicate the form, delete the original, and then rename the new one. Or get crafty with SQL queries at the db level.

Any other options I'm missing, or has anyone done this and have some pointers?

2

There currently isn't any way to delete all entries for a form.

Each form has its own DB table just for entries (For performance and the allowance of many forms with many different custom fields). All other information regarding the form is stored in another table, thus a TRUNCATE query would accomplish the clearing without damaging the table:

TRUNCATE TABLE exp_freeform_form_entries_FORMID

Replacing FORMID with the ID of the form you want to clear out.

TRUNCATE TABLE exp_freeform_form_entries_1

If you are uncomfortable doing manual SQL queries, there is a duplicate form button on the forms page, but unfortunately at the moment it does not copy field structure (This is on our bug list.) so you'd need to manually click each field you wanted on the duplicated form, use a dummy name, delete the first form, rename the new form, etc.

3
  • Pretty much what I expected - thanks for the SQL. A "delete all" option in the UI would be a nice feature-add..;) Sep 2 '14 at 11:27
  • +1 for a "delete all" option especially in light of EU laws and the upcoming GDPR rulings.
    – paulcripps
    Apr 17 '18 at 10:03
  • This method would not delete any related file uploads either in the db or on the file system.
    – AllInOne
    Jul 10 '19 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.