Redirect Old Slugs

About

If you are using “fancy permalinks” in WordPress, part of that permalink will be a “slug,” an all-lowercase dashed version of your post title… like this-is-a-slug. This becomes part of your permalink… and so it cannot change. But what if you decide you want to change it? What if you made a spelling error in your title, and don’t want the permalink’s slug to remain misspelled for all of eternity? You could either just change the slug, and have old links to the post break, or you could go through the trouble of setting up an Apache redirect for the old link to the new one.

This plugin was created to fill that need. Now you can change your post or page slugs with impunity. The plugin will notice when you change the slug of a published post or page, and it will save the old slug as a custom field (the key is old_slug). Now, when someone tries to go to the old post, the plugin will say “hey, that looks like one of the old slugs I saved, let me redirect you to the new location.” Thus, none of the links made to the old permalink are broken. You can change the slug multiple times… and all the old versions will forward to the current link.

Redirect Old Slugs has been tested on WordPress 1.5.2 and the in-development WordPress 2.0.

Note

This plugin’s functionality has been added to WordPress core as of version 2.1, so please deactivate the plugin if you have WordPress version 2.1 or higher!

Download

Instructions

  • Download and unzip
  • Upload redirect-old-slugs.php to your /wp-content/plugins/ directory.
  • Activate it from within the WordPress admin interface.
  • From now on, you can edit slugs without worry! If you have an old post whose slug you changed (prior to installing the plugin), you can manually add an old_slug Custom Field for that entry, and it will be forwarded.

Versions

  • 0.3 Plays better with other plugins, creates post_meta entries more intelligently
  • 0.2 Added support for MySQL < 4.1
  • 0.1 Initial release

I’ve spent a lot of time writing this code and supporting it. If you derive some benefit from this code, please consider showing your gratitute in a more tangible
way. Thanks!

I have received $0 this month for my coding efforts.

Donate with PayPalAmazon.com Wishlist


132 Responses to “Redirect Old Slugs”

Comment pages: « 1 [2]

  1. Jens |

    Will this plugin do a http-redirect with 301? Or is it just a header-redirect done with php? This one sends a temporary moved to … error to the search-engines, which wont help me…

    Better I just have a try. :-)

    Thanks for this plugin - in any case!

    Jens

  2. Trakin |

    Now this one is a very thoughful plugin. You can visit your old slugs and make new ones based on new popular keywords. A very good SEO technique I must say. However, I am going to try first with one of my old posts and wait to see the results. If it works properly- It will be really helpful. Thanks for your work !

  3. Chris |

    Yes thanks for your work - it was really usefull for me.

    Thanks a lot.

  4. Bornheim |

    Thanks for this plugin - in any case! Jürgen

Comment pages: « 1 [2]

Leave a Reply