Dec
23rd

WordPress 404: Page Not Found? Try these links…

I really appreciate sites that intelligently try to redirect you to the pages you may be looking for. Let’s say I’m looking for ajax information on a given site, I usually simply try to use the word in the URL to see what happens.

On Microsoft, see what happens:
http://www.microsoft.com/ajax
Helpful, huh?

Now try it on Yahoo!:
http://www.yahoo.com/ajax
Ugh!

How about our hero, Google:
http://www.google.com/ajax
C’mon! You’re a freakin’ search engine for heaven’s sake!

How difficult is it to simply take the words in the URL and come up with some search results that might guide you to the right page? It’s not so difficult!!! In fact, I programmed it into my site tonight in about an hour:
http://marketingtechblog.com/ajax

404 Related Posts

I simply used the same logic that the related posts widget code utilizes and applied it on the 404 not found page. It scores the content based on the keywords (there can be more than one) pulled from your URL. Your theme will need to support a 404 page in order to implement it. Also, this one is built for my theme, you may have to make some modifications.

Download the 404.php page here. Feel free to use it where ever you’d like! It does require that you have the Related Posts plugin!

  • Thanks, I downloaded your code, as I've got a couple places where I can use this. And, and for the record. Google is not a search engine, they're actually an advertising company. So, you can't really expect them to develop an intelligent 404 page ;)
  • True... but they should at least throw advertising on it!
  • Thanks, Rick! I think it's helpful, too... especially if you've moved some posts or deleted them.
  • Thank you, Doug. This is the most useful thing to do with a 404 page I've seen.
  • Tonight I noticed that there is a related posts plugin that also has 404 support here:
    http://wasabi.pbwiki.com/Related%20Entries
blog comments powered by Disqus