Making Better Use of Your Error “404″ Page
June 7, 2008 by Tony | Tag(s): 404 Page, WordPress, WordPress Code, WordPress Hacks
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.
Related WordPress Posts
- How To: Adding an Email This Button to Your Blog (0)
- How To: Adding a Print This Button to Your Theme (1)
- How To: Converting The Author Display To Link To The Author (0)
- Code: Adding Recent Comments To Your WordPress Theme (0)
- Huge Compilation of WordPress Code (0)
- Great List of WordPress Theme Hacks (0)

![Subscribe to [Blog Tutorials]](http://blogtut.com/wp-content/themes/BlogTutorialPro/images/rss.gif)
![[del.icio.us]](http://blogtut.com/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://blogtut.com/wp-content/plugins/bookmarkify/digg.png)
![[Facebook]](http://blogtut.com/wp-content/plugins/bookmarkify/facebook.png)
![[Google]](http://blogtut.com/wp-content/plugins/bookmarkify/google.png)
![[MySpace]](http://blogtut.com/wp-content/plugins/bookmarkify/myspace.png)
![[Newsvine]](http://blogtut.com/wp-content/plugins/bookmarkify/newsvine.png)
![[Reddit]](http://blogtut.com/wp-content/plugins/bookmarkify/reddit.png)
![[Slashdot]](http://blogtut.com/wp-content/plugins/bookmarkify/slashdot.png)
![[StumbleUpon]](http://blogtut.com/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://blogtut.com/wp-content/plugins/bookmarkify/technorati.png)
![[Windows Live]](http://blogtut.com/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://blogtut.com/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://blogtut.com/wp-content/plugins/bookmarkify/email.png)






Comments
Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!