404 page – useful to readers & meaningful to (search engine)spiders
In my earlier post I showed how to build a user-friendly 404 error page for your blog. Now that we have learnt how to make it user-friendly we should now focus on making it search engine optimised. Because most of the 404 pages we create do not provide the necessary 404 header which could make search engines penalize you for duplicate content. Let me show how to prepare a 404 page that is useful to the readers as well as meaningful to the search engines.
The most popular options in a 404 page that are used in order to make it user-friendly are
- Providing some explanation to user for “ Why it happened ?”.
- Giving him some related links.
- Provide some helpful links.
i. Go to the homepage.
ii. Go back.
iii. Contact Us. etc - Providing him an option to search the blog.
- Redirect him automatically to the homepage.
The 1st option is what our default 404.php have. And earlier I’ve showed how to incorporate the options 2nd, 3rd ( Go to the homepage ) & 4th. In this post I’ll let you know how to provide the rest options as well as make it Search Engine Optimised. Follow the steps as described. Copy the mentioned codes & place them as instructed.
Redirecting to the homepage automatically :
1. Copy the above code(meta tag) & place it between the header( <head>, </head>) tags.The “content=15“ means the page will be automatically redirected to homepage after 15 secs. You can also change the value if you wish.
|
<meta http-equiv=“refresh” content=“10;url=<?php echo $homeUrl;?>” /> |
2. Now create an .htaccess file if there is none or edit it if you have it under your root folder. Put the following line at the end of the file.
ErrorDocument 404 /404.php
Make it Search Engine Optimized :
Add the following piece of code before your page coding starts i.e before the <html> tag.
|
<?php |
Providing the ‘ Go Back ‘ And ‘ Contact Us ’ Link :
Copy the following code & then paste it with proper CSS( if you care for good design).
|
<li><a href=“javascript:history.back();”>Go Back Where You Came From</a></li> |
Visit here to see for yourself how it works.
So now you have a user-friendly as well as a search engine friendly 404 error page. If you have any problem in understanding feel free to ask. I’ll be happy to help.
NB : If you don’t want the pain of doing the coding yourself feel free to download the 404.php with all necessary instructions. I’ve designed it for you.
Related Articles
- Optimizing the Title tags of your Wordpress Blog template
- How to Show Meta Description as Post Excerpts in Blog’s Home page
- Wordpress Post Slugs : How to improve your Article URLS ?
- Take Maximum advantage of the All in One Seo Pack Plugin
- Kickasstorrents.com – Search all the Torrents Sites at one place








