Sometimes, you may need to delete all Visitor log data for a given date, and/or a given website. For example if you have imported log files incorrectly in Piwik you may want to delete the invalid data that was imported. In Piwik 2.14.0 we released a new console command which you can use to delete all visitor log data (including Visits, Actions, Goal conversions, Ecommerce activity).

To use this console command, login to your server (using SSH) and go in the Piwik directory. Execute the following command to display the help:

./console help core:delete-logs-data

The following options are available:

  • --dates lets you delete log data with a date within this date range. Eg, 2012-01-01,2013-01-01
  • --idsite lets you delete log data belonging to the site with this ID. Comma separated list of website id. Eg, 1, 2, 3, etc. By default log data from all sites is purged.
  • --limit lets you pick the number of rows to delete at a time. The larger the number, the more time is spent deleting logs, and the less progress will be printed to the screen. (default: 1000)

For example to delete all log data for month of January 2015 on website ID 42, execute:

./console core:delete-logs-data --dates=2015-01-01,2015-01-31 --idsite=42

Notes

  • all the visitor log data for the given date range and website ID will be permanently deleted.
  • this console command does not delete your archived report data but only delete the raw visitor log data.

Related FAQs

If you want to configure Piwik to automatically purge your old data (whether visitor log data, or statistics reports data), see this FAQ How do I delete historical Piwik data? (purge old logs and/or old processed reports)

If you want to delete old reports, read this FAQ: How do I delete all statistics for a given website, or for all websites?

Any questions?

Many answers and more information about Piwik You can find here:

We are social

Follow us: