I accidentally enabled all importer parameters. In this way, a lot of useless data has been saved to DB which increases the statistics and visits too much. Is there a way to clean up the DB leaving only the useful data?
Parameter used are: --recorders=4 --enable-http-errors --enable-http-redirects --enable-static --enable-bots
To clean trash data in Matomo, you need to remove unnecessary logs, old visits, and unused reports to keep analytics accurate and improve performance. Here’s a simple step-by-step guide:
1. Enable Data Retention Settings
Go to Administration
Click Privacy → Anonymize Data
Enable Delete old visitor logs
Set retention period (e.g., 90 days or 180 days)
Save changes
This automatically removes outdated data from your database.
2. Purge Old Reports
Navigate to Administration → System → General Settings
Enable Delete old reports
Choose how long to keep aggregated reports
Save and apply
This helps remove unnecessary historical summaries.
3. Delete Bots & Spam Traffic
Go to Administration → Websites → Bot Filtering
Enable Exclude known bots
Add spam referrers in Referrer Spam Blacklist
Save changes
This prevents future junk data from being stored.
4. Clean Logs Manually (Advanced)
If you manage your server:
Run Matomo console command:
./console core:purge-old-archive-data
This clears archived data that is no longer needed.
As suggested you can remove the raw data logs, but keep in mind you won’t be able to archive these date ranges again or create custom reports using historical data.