Home of Publicist KelleyBurrus is a brand publicist

15Jan/084

How to redirect dead link on wordpress ?

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
Comments (4) Trackbacks (0)
  1. Thank you much for this informational blog post.

  2. Good dispatch and this fill someone in on helped me alot in my college assignement. Say thank you you for your information.

  3. Thanks for this useful article.

  4. Hi there,

    This is a inquiry for the webmaster/admin here at http://www.kelleyburrus.com.

    May I use part of the information from your blog post right above if I give a backlink back to this website?

    Thanks,
    Peter


Leave a comment

(required)

Trackbacks are disabled.