Most themes typically come with a 404.php page that shows up by default whenever an invalid URL is visited on your blog. Depending on how often you change the URL of existing posts or delete old posts, it may or may not be a high traffic page for your blog.

Either way, when a typical web surfer finds your blog and is greeted with the lovely 404 page, they will most commonly just click the “Back” button on their browser and continue browsing through the other search results. If your 404 page is setup correctly, you can often retain that traffic by either offering something funny to grab the readers attention or by offering a variety of methods for them to find the post they are looking for. Over at Theme Playground I ran across a great post about customizing your 404 page, which includes a bunch of suggestions for retaining that traffic.

I personally prefer to provide useful resources on my 404 pages, so I will typically use something like the following code to help search engine traffic hopefully find what they are looking for:

<h1>Not Found, Error 404</h1>
<p>The page you are looking for no longer exists.</p>
<p>Perhaps you can find what you are looking for by searching the site archives!</p>
<b>Search by Page:</b>
<?php wp_list_pages('title_li='); ?>
<b>Search by Month:</b>
<?php wp_get_archives('type=monthly'); ?>
<b>Search by Category:</b>
<?php wp_list_cats('sort_column=name'); ?>

I will also sometimes call the search box (usually searchform.php) and the popular posts plugin as well to help retain that traffic, depending on the type of blog the 404 page is being built for. How do you have your 404 page setup?

Kyle Eslick is WordPress enthusiast who took his passion for WordPress to the next level in 2007 by launching as a place to share hacks, tutorials, etc. Connect with Kyle on Twitter or Google+!