Useful Sites
Business owners can apply for the best credit cards available from JSNet.org and even earn when they spend!
Getting your brand recognised is expensive, secured loans from Glitec Loans can help finance this venture.

PostHeaderIcon How to redirect dead link on wordpress ?

This article is made by www.kelleyburrus.com and was first published on January 15th, 2008. This article is free to redistributed for non-commercial purposes as long as you include the name of the author and source, and not make changes to the contents of the article.

When the visitor visit the link that has die or a post that has been deleted by the owner of the website / blog. Most of the visitor that see a page like this will soon close the page and (if the visitor comes from search engines) will soon open the next search engine results.

Of course we do not want things like this happen on our blog visitor, the visitor close our blog because they do not find what they are looking for.
We can make a redirect (divert) eror 404 pages to other URL as we like, for example to the home or to a kategory. How to do that ? the answer is  by  edit the 404 template (404.php) through the Theme Editor.

Here is the steps :
  • Dashboard of WordPress (WP-admin) menu go to Theme Editor.
  • Select File 404 Themes Template (404.php). The nyou fwill found php code like this (not always the same):
    <?php get_header(); ?><div id=”content”>
    <div id=”wrap”>
    <div id=”contentleft”>
    <div class=”postwrap”>
    <h2><?php _e(’404 – Not Found’); ?></h2>
    <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
    </div>
    </div>
    <?php get_sidebar(); ?>
    </div>
    </div>
    <!– The main column ends –>
    <?php get_footer(); ?>
  • Erase all the code and replace with the following code:
    <?php
    header(“Status: 301 Moved Permanently”);
    header(“Location:http://www.derstinationUrl.com”);
    ?>
  • Change http://www.destinationUrl.com with the destination URL you want to do, eg to the home page of your blog.
  • Click the Update File, then  done.

Now if a visitor open your dead link or typed wrong url they will automatically redirect to your blog homepage.

Related posts:

  1. Increasing traffic to your WordPress based blog
  2. The art of writing blogs
  3. Where do creative businesses begin online?
  4. Tips to choose reliable web hosting service

3 Responses to “How to redirect dead link on wordpress ?”

Post Your Comment

Copyright © 2010 Home of Publicist.