I’m sorry to ask this as it might be obvious for an experienced user but how and where do I run the following the code to purge my
logs? It is not mentioned on the FAQ page. Thank you!
DELETE piwik_log_visit, piwik_log_link_visit_action
FROM piwik_log_visit INNER JOIN piwik_log_link_visit_action
WHERE piwik_log_visit.idvisit = piwik_log_link_visit_action.idvisit
AND visit_server_date <= CURRENT_DATE() - 30
Assuming that your sql-statement is correct, you can copy it an run it directly in phpmyadmin. phpmyadmin allows you to run the statement in the tab “sql”.
Thank you! It did the trick. style_emoticons/<#EMO_DIR#>/smile.gif
I also wish to ask, when pruning the logs, does it affect the database size? Or it doesn’t? Does it get reduced?
Finally, is it also possible to prune logs for a particular month? I have an installation where began using it mid-month and I wish to prune logs for that month.
The feature of automatically deleting old older than 7/30/N days is now available in Piwik, under Settings > Privacy > Delete old logs from the database.