Does your blog have a 404 Page? Do you know what one is? And even if you can answer yes to both questions, are you making the most of it?
Page Not Found
A 404 error is what’s generated when somebody searches for a page on your blog that is no longer there, or indeed may never have existed. For example, if you once had a post titled ‘List of top webhosts’ which you then deleted for whatever reason at a later date, the URL to that post would still live on in search engines for some time, and still bring people to your blog. So when they arrive, and the page no longer exists, they will receive a ‘404 - Page not found’ error.
If your blog template has a ‘404.php’ page then that is what the visitor will see, if not they’ll just get the standard error page provided by your webhost. Typically, it will be short and to the point and will simply say something like ‘The page you are looking for no longer exists’.
Goodbye!
Typically at this point, the visitor will shrug their shoulders and move onto another website, and this is why a lot of people customise their 404 page to include a search bar, adverts or maybe even a related posts tag. However, this far from perfect, as the search bar requires effort on the part of the visitor, ads will take them away from your site and much as I love it, the related posts plugin output is often far from accurate. So what if there was a way to get Google to search your blog, and provide a list of pages all from your site relevant to the visitors search term…….
Ask Apache
As ever when you’re on WordPress, the answer is simple - download the AskApache Google 404 plugin and follow these simple steps:
- Install the plugin on your blog and activate it.
- Visit the Google Search API page, signup and get your key. You need a Google account, but if you’ve got Gmail then you already have one.
- In your blog dashboard, go to ‘Options’ and then ‘AA Google 404′. Select the existing key, delete it and then paste in your new key. Hit ‘Update Code’.
- Open up your 404.php file using WordPad or a similar text editor (not a word processor). Find the line containing your error message (i.e. ‘The page you are looking for is no longer here’) delete it, and replace with this code:
<?php if(function_exists('aa_google_404'))aa_google_404();?>
- That’s it!
If your chosen theme doesn’t have a 404 file, and some don’t, then just create one. Just open up your index.php file, strip out everything related to the post content, leaving the calls to the header, sidebars and footer intact and then paste in the line of code from ‘4′ above in place of the post content. Save as 404.php, upload it and there you have it.
Themes are coded differently, so I can’t give you exact instructions, but if you get stuck mail me your index.php file & I’ll have a look.
To see it in action, just click on this URL for Blog-Op which doesn’t exist: http://blog-op.com/missing/
Attempt to visit a similar URL for your own blog (assuming you don’t have a post titled ‘missing’!) and you’ll see the difference. What’s the point? Well for one thing Google will provide the closest matches to an existing post on your blog, and for another it asks nothing more of a visitor than a single click, thus keeping them on your blog. And now you know how to customise your 404 page, there’s nothing to stop you doing more like adding some adblocks, or a personalised message.
Thanks to RT for putting me on to this excellent plugin.