Support » Fixing WordPress » Old links does not work after Changing my Own Directory and permalinks

Viewing 1 replies (of 1 total)
  • There are at least two ways to fix your internal links. (This won’t fix the indexed links of Google).

    The first, easiest and safest, is to replace the text on output. One way to do this is to put the following line in your theme’s functions.php template:

    add_filter('the_content', create_function('$a','return str_replace("http://ericreboisson.free.fr/wordpress","http://ericreboisson.free.fr",$a);'));

    The second, permanent and more dangerous, is to replace the text in your database. I say dangerous, because if you mess this up, you could really mess up your posts. You must back up your database before trying this, and you shouldn’t attempt it if you feel uncomfortable at all about it. I’m telling you how to do it, not saying that you should.

    If you did this, you would run the following query, using phpMyAdmin or the like:

    UPDATE wp_posts SET post_content=REPLACE(post_content, "http://ericreboisson.free.fr/wordpress","http://ericreboisson.free.fr");
Viewing 1 replies (of 1 total)
  • The topic ‘Old links does not work after Changing my Own Directory and permalinks’ is closed to new replies.