I've recently changed a lot of node URLs and I'm getting a lot of 404s. I'm trying to find out which URLs I've rectified so I'm trying to flush the logs of the 404's on the "Top 'page not found' errors" page. I tried to adjust the time on "access log settings" to clear out the logs to no avail.

So how do I clear the "Top 'page not found' errors" page entries?

Comments

Technonow’s picture

Was there ever a solution to this suitable for 6.4?

How do you delete top entries?

Does nobody know, or is it just not possible?

goups’s picture

Check the watchdog table in your db.

This is the SQL syntax to remove them all:
DELETE FROM watchdog WHERE type="page not found";

To delete the only the pages you got the error:
DELETE FROM watchdog WHERE type="page not found" AND location="http://www.website.org/pagenotavailable.html" ;

joelkriner’s picture

I have some "page not found" nodes which I would like to completely delete. Are there any non-sql options. I am a noobie.

Thanks.

jackie.taferner’s picture

To do this within your admin area (no direct database edits), follow these steps:

1. Go to Administer > Site Configuration > Logging and Alerts > Database Logging
2. Set the discard to whatever amount you'd like. If you want a minimal amount, select 100.
3. Click "Save Configuration"
4. Go to Administer > Reports > Status Report
5. Click "run cron manually"
6. Check your "Recent Log Entries" now, and you'll see they've been shortened to the most recent errors up until the discard length you specified in step 2

GaneshKumar’s picture

For Drupal 7:
Go to Reports >> Recent Log Messages
Click on the Clear Log Messages, then you can able to see Clear Log Messages button into it.
Click on that button and go to Top "Page not found" errors page. The list will flushed out.

grahamvalue’s picture

This will clear all messages, not just the page not found ones.

grahamvalue’s picture

Do you know if DELETE FROM watchdog will cause any referential problems?
Do any other tables refer to the wid in the watchdog table?

ressa’s picture

With Drush 13 in Drupal 11, this SQL syntax shows them all:

drush sql:query "SELECT * FROM watchdog WHERE type='page not found'";

An example, which deletes only entries containing the string "/da/" :

drush sql:query "DELETE FROM watchdog WHERE type='page not found' AND location LIKE '%/da/%'";