While browsing my feeds, I noticed an interesting post over at JohnCow explaining how to make money online with missing pages. The author noticed that a lot of traffic was ending up on his error page (almost 26,000 people to be exact) and felt that there had to be a better way to use this page so there wasn’t so much wasted traffic.

In the authors example, the idea is to redirect all traffic that hits his 404 page to his “make money” page, which contains affiliate links and other ways to get paid. While this example probably wouldn’t apply to most of us, I do think that it might be a good idea to redirect these bloggers to a more important page on your blog, such as your homepage.

In order to do so, you simply need to do a quick edit to your 404.php page (which most themes should have). Before attempting, make sure you have a backup copy of your 404.php page in case something goes wrong. You’ll want to add this code to the top of your 404.php page:

<?php
header ('Location: http://yourhomepageurl/' );
?>

You’ll of course want to manually enter your homepage URL. If you have a favorite post you’d like to promote, you could instead add the URL to that post.

If you’d prefer not to redirect your 404 page, you can always customize it to help the potential reader to find what they were looking for.

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. Matthew says:

    I find this sort of solution confusing to users, who are being sent to a page they didn’t request and who aren’t being told how they got there. A better idea is to write a custom 404 page that gives the browser some options. Using WP Stats and the WP Stats Helper plugin, you can easily make a dynamic, custom 404 page that helps lost users make their way back into your website.

    Example: http://silverpenpub.net/404

    There are also a variety of plugins for WordPress to create custom 404s, I just never found these satisfactory.

  2. Corey Freeman says:

    Thanks for this awesome trick! I’m trying it out on my personal blog to see how it goes.

  3. asaf says:

    WOW

    works great!

    Thanks

  4. Matt says:

    Thanks for this post.

    For a while my 404 was broken. A 404 page 404′ing..oops.

  5. Rajan Balana says:

    Thanks a Lot. It was really very helpful for me :)

Trackbacks/Pingbacks »

  1. 50 tips y trucos para optimizar Blogger y WP | Blog en Serio says:
  2. 25 hacks para dinamizar seu Wordpress! — Bytes a Go-go! says:
  3. 63 essenziali Wordpress Hacks, Tutorials, Help Files e Cheats : technorati.it says:
  4. Wordpress Tutorials/Hacks « The house of software freeware says:
  5. 20 Places For Wordpress Hacks | Index Blog says:
  6. Optimize 404 Page for Traffic says:
  7. Guesworld.Com | Graphic is Life says:
  8. 63 correções, tutoriais, arquivos de ajuda e dicas essenciais para Wordpress | Rafael Bernard Araújo says:
  9. Wordpress ile ilgili 155 kaynak « YEAH28 - Her ?ey Sizin ?çin says:
  10. Best of WordPress Tutorials – More than 100 recourses | Tutorials | .:Lirent.net Hacks:. | All about Web 2.0, SEO, PHP5, Ajax, Adsense, Unix/Linux, Free Stuff, OpenSource, Designs, Wordpress, Hi-Tech etc says:
  11. 250 Wordpress Tutorials says:
  12. 135 link cung c?p th? thu?t wordpress hot nh?t | T?p Chí SEO says: