Delete Month of Website Visitors from Piwik Analytics Logs

To delete an entire month of website visitors to one of your Piwik tracked websites, follow these three easy steps.

Step 1: Log in to phpMyAdmin

Log in to phpMyAdmin and go to your Piwik database.

Step 2:Delete Website Visitors from First Table

Open up the table, piwik_log_link_visit_action. Then run the following query to first simply see what will be deleted (this MySQL query will not delete anything):

SELECT * FROM `piwik_log_link_visit_action` WHERE `idsite` = 1 AND `server_time` >= '2015-06'

The above MySQL query selects all of the website visitors to your Piwik website with the ID of 1, that visited in June 2015.

To delete these visitors, run the following MySQL query:

DELETE FROM `piwik_log_link_visit_action` WHERE `idsite` = 1 AND `server_time` >= '2015-06'

Step 3:Delete Website Visitors from Second Table

Open up the table, piwik_log_visit. Then run the following query to first simply see what will be deleted (this MySQL query will not delete anything):

SELECT * FROM `piwik_log_visit` WHERE `idsite` = 1 AND `visit_last_action_time` >= '2015-06'

The above MySQL query selects all of the website visitors to your Piwik website with the ID of 1, that visited in June 2015.

To delete these visitors, run the following MySQL query:

DELETE FROM `piwik_log_visit` WHERE `idsite` = 1 AND `visit_last_action_time` >= '2015-06'

All website visitors that visited your Piwik website with the ID of 1, that visited in June 2015 will now have been deleted.