Bulk Delete Form Analytics Reports

Is there a way to delete form analytics reports in bulk? One of our devs made the mistake of forgetting to specify a form name, and since our website uses Ember and our form is on a component, it has a semi-random string attached to it’s ID. The end result is literally hundreds of different reports (since Matomo falls back to ID of the form if there’s not a form name) for the same form. This is probably a textbook example of why not to allow automatic generation of unlimited form analytics reports and that’s a discussion we’re having internally right now.

In the meantime, I’m not excited about the prospect of clicking the delete button for every single report, wait for it to process and then reload the list so I can do that all over again, hundreds of times. Is there a way via the console or an API that I can delete these reports en masse? I’m not familiar with how Matomo organizes its data in the database, but I’m really close to breaking down and figuring it out so I can write a SQL query to take care of this (we use the on-premise software btw). Thanks for any help or insights into this.

Just a very quick answer before the support team gets to it:

The Form Analytics plugin has an API that allows easily deleting forms (unfortunately just one-by-one, but you could automate this)


1 Like

Oy, I don’t know how I skipped over this section of the docs. Thanks!

It would also be safe to delete the forms (in phpmyadmin for example) from the site_form table https://developer.matomo.org/guides/database-schema#form-analytics