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>
<ul>
<?php wp_list_pages('title_li='); ?>
</ul>
<b>Search by Month:</b>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
<b>Search by Category:</b>
<ul>
<?php wp_list_cats('sort_column=name'); ?>
</ul>

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 WPHacks.com as a place to share hacks, tutorials, etc. Connect with Kyle on Twitter or Google+!

  1. K-IntheHouse says:

    I use the AskApache 404 plugin for WordPress. It’s hard to describe but you can see it in action here.

    It is supposed to give a SEO-boost as well as gives useful results to users from your site as well as Google in neatly tabbed interface!

  2. Marcio Gazetta says:

    Hi, I use this code in my blog, and i´m feeling happy with the result

  3. Toronto Guy says:

    On one of my other sites that has tons of old backlinks from various posts (its a dropped domain) I even threw up some affiliate ads on the 404 page that matched the old domain name.

  4. Dawn says:

    I use the Dunstan Style plugin for my 404 page, I love it http://www.andrewferguson.net/wordpress-plugins/dunstan-style-error-page/ based on http://1976design.com/blog/error/ you can see it in action on my site at http://blog.yourwish.co.nz/test

    /dawn

  5. Luis says:

    So good man.. you are doing a great job with this fantastic site

  6. Sam says:

    thanks ,i need it.

  7. moralde says:

    Hmmmm. So even the 404 page can be given better value. I think I’m gonna give it a try.

  8. ngemig says:

    I try it.. Thanks

Trackbacks/Pingbacks »

  1. paidnetpedia.com says:
  2. SEO & Web Design » Blog Archive » Mastering Your WordPress Theme Hacks and Techniques says:
  3. Make The Error 404 Page Work For You | The Home Business Archive says:
  4. wordpress düzenleme ve ki?iselle?tirme yollar? « Bay Bedava – Netten Ba?l?klar says:
  5. wordpress düzenleme ve ki?iselle?tirme yollar? | Teknoloji Soka?? says:
  6. 10 Ways to Customize and Personalize your Wordpress Blog | SEO & Web Design says:
  7. Aju-lee » Archive » 10??????WordPressblog?????? says:
  8. 37 Cool Wordpress Hacks And Tutorials You Should Try | Afif Fattouh - Web Specialist says:
  9. 37?Wordpress???? | ??? says:
  10. WordPress Error 404 Pages: Essential Tips and Tools | DesignerLinks | Home to Web design news, jQuery Tutorials, CSS tutorials, Web Designing tutorials, JavaScript tutorials and more! says:
  11. WordPress Error 404 Pages: Essential Tips and Tools | #! Jack Script says:
  12. WordPress Error 404 Pages: Essential Tips and Tools | IdolMasti says:
  13. WordPress Error 404 Pages: Essential Tips and Tools | Internet Marketing Guru says:
  14. WordPress Error 404 Pages: Essential Tips And Tools says:
  15. WordPress Error 404 Pages: Essential Tips And Tools | How It Easy (HIE) Computing community says:
  16. WordPress :Error 404 Pages: Essential Tips and Tools : facedesign.us says:
  17. WordPress Error 404 Pages: Essential Tips and Tools | WebDino.net says:
  18. WordPress Error 404 Pages: Essential Tips and Tools | Play.GlamourHits.com | says:
  19. Cool Error 404 pages handling tricks | DesDevWeb says: