How do I remove wrongly logged page views?

After a website update, we got wrong logging of page urls:
host.domain/undefinedfunction search() { [native code] }

I understand I can unvalidate reports, then re calculate them by reading logs. But I’m missing how do I remove that “url” from logs.

Anyone? Any help is appreciated. Thank you in advance

Well, I managed to do this query but looks like very expensive :expressionless:
Am I going to the right direction?

SELECT idsite,, server_time FROM piwik.piwik_log_link_visit_action as aa
JOIN piwik.piwik_log_action as bb
ON aa.idaction_url = bb.idaction
WHERE LIKE '%search(%'
ORDER BY server_time DESC

Hi Tassoman,

it’s the right way. Matomo wrote, that a function like this is projected, but … nothing.

Use mysql query SELECT and find all this wrong Urls. Notice the database table name and maybe also the entries.

Find the connections to this database table. Databases used the ID from the one table in other tables for connect datas. With a mysql query JOIN it is possible to display all the connected data. Find it with mysql query SELECT.

Mysql Joins:
Maybe a Triple Join is needed.

Maybe download the database tables with the raw data (logs) and use a text editor for a search.


mysqldump -u username -pPassword -h database_name table_name > YYYYMMDD-database_name-table_name.sql

-pPassword without whitespace.

You must decide what you needed, ass well as what is correct:

Use mysql query DELETE to delete all the database table rows that are connected with the wrong URL entries.
Use mysql query UPDATE to empty the database table cell data in the selected rows.

So theoretically, in one table are the wrong Urls saved, and in other tables only the IDs saved, that are connected to this wrong Urls.

Test all before with SELECT.
Make a database backup before.

Do it on your own risk.

Invalidate all (arrchived) reports.

Run all scheduled tasks manually.
core:run-scheduled-tasks --force

Purge old archived report data.
core:purge-old-archive-data all

Run the archive process (maybe server and time expansive).

Make a database backup.

Yes, it’s a little bit complicated.
Good luck!

1 Like