SearchForecast Marketplace

Enhance Your WordPress Blog 404 Page

Posted by: dragonblogger  //  Category: blogging

One of the highest recommendations I have is to make sure when a user hits a dead page on your blog they have the ability to easily navigate around to a proper page, give them everything at their fingertips so that they can find another page rather than leave your blog and go off to read something else.

Google provides some useful code that you can plug into your 404.php page and add a search box directly on your 404 page, it also will sometimes offer best matches, but this functionality is iffy and sometimes works, when it does its nice, when it doesn’t it is still useful to have a search form right on your 404 page.

Here is basically what you have to do to enhance your 404.php page

1st you must have a Google WebMaster account (and it is recommended you get the <script> lines in red below from cut/pasting them from your webmaster tools section.
Once you have that code

Go into your WordPress Admin
Click on “Editor”
Edit your blogs 404.php

Inside the DIV post section change the following:  (The red sections are the parts you add and customize)
(Note:  You must have a Google webmaster account and your blog registered with Google WebMaster tools to utilize the enhanced google 404 page code)

<div class=”post”>
<div class=”post-title”>
<div class=”post-date”></div>
<h2>404 – POST NOT FOUND</H2>
</div>
<div class=”post-entry”>
<p>Sorry the requested page cannot be found, please try going to the home page <a href=”http://www.YOURSITE.com”>YOUR SITE</a> or you can search for what you are looking for below.
<script type=”text/javascript”>
var GOOG_FIXURL_LANG = ‘en’;
var GOOG_FIXURL_SITE = ‘http://www.YOURSITE.com/’;
</script>
<script type=”text/javascript”
src=”http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js”></script>
<p> -Your Blog Account</p>
</div>

So this is what my custom 404 page looks like now after enhancing it:

custom4041

-Dragon Blogger

Related posts:

  1. Adding Google Analytics to your WordPress Blog I have compiled a list of tips and helpful hints for anyone who needs to add Google Analytics code for...
  2. WordPress Tip: Fix your Blog’s 404.php page I was having trouble with both of my 2 blogs Dragon Blogger and Rock Along Productions where the 404.php page...
  3. Manually Add the TweetMeme Submit Button to WordPress This code lets you manually place the TweetMeme submit button exactly where you want on your wordpress posts. You just...
  4. Improve Your WordPress Page Load Performance Four Wordpress Plug-ins to help you improve your blog pageload performance by compressing images, CSS, HTML files and caching your...
  5. Adding A BlogNetAward Widget To Your WordPress Blog My friends over at BlogNetAwards enjoyed my “How to vote” video demonstration and asked that I create another demonstration showing...


If you enjoyed this post, subscribe to DragonBlogger.com
via FaceBook, Twitter, RSS or Email
or
Enter your email and subscribe now!
Email:

Written by dragonblogger (1110 Articles Published)

Working in the IT Industry for over 10 years and specializing in web based technologies. Dragon Blogger has unique insights and opinions to how the internet and web technology works. An Avid movie fan, video game fan and fan of trying anything and everything new.

Follow dragonblogger on Twitter @dragonblogger

Tags: , , , , , , , , , ,

One Response to “Enhance Your WordPress Blog 404 Page”

  1. Joel from hgh (1 comments) Says:

    Apart from such direct hack, there must be several plugins by which we can enhance 404 pages? Don’t remember exactly but i guess there is one called “my 404 is better than yours” something. Especially when you’re not php geek, they can help better.

    [Reply]

Leave a Reply

CommentLuv Enabled

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.

Comments links could be nofollow free.