404 not found report

Last changed: August 29, 2014 Comments: 3

Track your 404 hits!

Do you keep track of your 404 not found hits ? If you don’t, try this simple plugin.
It will keep track of the hits on your 404 not found page.

Useful for what ?

Well, probably you removed or relocated some categories, pages, posts etc etc a while ago or maybe just a couple of weeks without knowing anymore.
Right now it sucks search engines already checked your website and took a notice of those URI’s or maybe you have some anchors on your own website pointing to moved URI’s.
Those visitors arrives on your 404 not found page with a notice that the page they are looking for not exists anymore.
Some visitors will stay on your site and look for the particular page, but the other group leaves immediately. What a shame…

What does this plugin do ?

This plugin tracks those visits on your 404 – not found page. It stores the time, requested URI and Referer.
More information is absolutely not needed. The time and referer does already overdo it, but maybe you can get some extra information out of it.
Thos information is stored in a txt file since i found it quite useles to create a new table or use the database in the first place.
With 1 single click on the button you empty the file when you’re done with taking the appropriate actions on the results.
You may want to add rewrite conditions @ your .htaccess file or use a seperate plugin for adding redirects.
You can check the report within the admin settings menu – 404 report

How do i get it to work ?

1) Upload this plugin into your plugin directory. Activate the plugin: admin->plugins.
2) Open your 404.php page within your theme and add the following snippet somewhere on that page.

# 404 reporting
if (class_exists('NotFound_404')){
    $Error404 = new NotFound_404();

3) Change the permissions (CHMOD) of the file 404.txt to 600.

Have fun logging!

This plugin might be useful along with Simple 301 Redirects for wordpress plugin.

Attachments 1 image(s) & 0 video(s) found.
404 not found
404 not found
3.0 KiB
  1. […] Change the permissions (CHMOD) of the file 404.txt to 600. Category plugin […]

  2. KillerSneak says:

    My theme doesn’t have a 404.php .. What should i do buddy?

  3. TheWriter says:

    Hi, hope you are doing fine ? Didn’t see you on BFBC2 ?!

    If you want to prevent people from seeing a 404 page, just create one, copy the snippet from this post into that page, along with header() or wp_redirect().

    With one of those functions you can immediately redirect your visitor to whatever page you want and still log the request.

Just tell us...