As a follow up to yesterday’s post about WordPress permalink structure (where a good discussion took place in the comments), I decided today that I would dedicate a post to showing you how to switch your blog’s permalink structure without creating any invalid URL’s.
The easiest way to accomplish this is to grab the Permalink Redirect plugin (my plugin review here) and activate it. Once activated, when you go into the Settings panel you should find a new tab called Permalink Redirect. Scroll down to the bottom of the page and you should see this:
In the old permalink structures box, you can paste your current permalink structure there (depending on which you choose, something like /%year%/%monthnum%/%day%/%postname%/). If you are unsure what exactly to type, please refer to the permalink page on the WordPress Codex.
Now save and go to the Permalinks tab. Select the custom field and type /%postname%/, then save.
Now go to an old URL and it should automatically redirect you to the same post’s new URL. The search engines will see the 301 redirect and update accordingly!
Any questions? Feel free to comment below!










Friday, April 4th, 2008 at 5:57 am
The plugin fails to activate on my server:
Fatal error: Cannot redeclare wp_redirect() (previously declared in /wp-includes/pluggable.php:673) in /wp-content/plugins/ylsy_permalink_redirect.php on line 304
Friday, April 4th, 2008 at 6:50 am
How long do you have to keep this plugin active until you’re sure that the search engines have discovered your new permalink structure?
Friday, April 4th, 2008 at 6:54 am
Or get Urban Giraffe’s Redirection or Advanced Permalinks plug ins.
Friday, April 4th, 2008 at 7:56 am
@ Ronny - Not sure why that is happening, I’ve never had any problems with this plugin on any of my blogs. It is probably a problem with your webhost. See some of the suggestions below!
@ A.J. - If you are just using it for a redirect, then you can just wait until the search engines update. However, if you de-activate it, any inbound links would become 404 errors so you should keep it active for quite awhile, if not permanently. It also does a 301 Redirect for your www and non-www and adds the / to your URL’s for consistency.
@ Rob - Thanks for the other recommendations. I like Permalink Redirect because it also does a Feedburner feed redirect as well. (Though those might also, I haven’t tried them)
Friday, April 4th, 2008 at 2:53 pm
After yesterday’s post I gave the url redirect plugin a try and got the same error as Ronny.
I made the permalink change and the redirect worked without the plugin. I haven’t checked yet, but does 2.5 have this ability now?
Friday, April 4th, 2008 at 4:11 pm
@ Richard - Good question. I haven’t tried this since WordPress 2.2 or so. I’ll see if I can get it answered here shortly!
Friday, April 4th, 2008 at 11:15 pm
@Kyle: If I’m not mistaken, Urban Giraffe’s Redirection plug does a Feedburner feed re-direct, too.
Saturday, April 5th, 2008 at 6:47 am
I am not sure if it’s a good idea if everybody suddenly switches their permalink structure.
1) First, were is the evidence that urls without dates are better, SEOwise? So far I’ve only read some subjective opinions on this. As is often the case with SEO issues.
2) Don’t forget that URLs with dates can be (very) useful for users. Seeing /blog/2008/03/31/new-dvd-players or /blog/2003/01/03-newest-dvd-payers gives me, as a user a lot of important information!
Saturday, April 5th, 2008 at 8:04 am
@Matthijs: URLs with dates can be very effective in the matter you present it, but it can confuse as well. An example is, it’s different how we date things in Europe and the US. YYYY/MM/DD and YYYY/DD/MM is two very diffrent things.
Saturday, April 5th, 2008 at 10:26 am
@ Rob - Thanks! I certainly wasn’t saying that Permalink Redirect was the only one, was just pointing out some of the reasons I like it.
@ Matthijs - First of all, these opinions are from Matt Cutts, the lead guy with the Google search team. If your site wants traffic from Google, his opinions probably matter the most.
Matt also mentioned to make dates visible in your posts, but not in the URL. People should be able to get the date from the post if they want it, though on some of my sites I avoid the date all together because over time posts that stay popular years later can sometimes still be very valid but will lose credibility with readers if they see its a few years old. Really just a judgment call based upon your website and your preferences.
@ Ronny - Great point as well. I’ve also been meaning to test and see if you publish a post then a few days later go in and change it to a different date, if the URL remains the same. I assume it wouldn’t change, but never confirmed. Same goes for people with categories in their post URL’s.
Saturday, April 5th, 2008 at 10:29 am
Oh, as for people wondering if you should change your permalink structure, that is really up to you. This blog was designed more as a place to provide resources and explain how to do things rather than getting into whether you should or not.
I have my opinions that I share sometimes in my posts, but I more or less just want to explain how to do stuff. I leave much of the advice stuff to other blogs.
Sunday, April 6th, 2008 at 5:42 pm
Thanks so much for this - couldn’t be easier!
Monday, April 21st, 2008 at 9:32 pm
Hy From France .
My Website is on a Windows server.
How can i have
Old Permalinks like http://www.hkrag.fr/blog/?p=217
and Too use /%postname%
I can have after more and more tests :
http://www.hkrag.fr/blog/index.php/sample-post/
but too old link p=217 never continue to be Ok
What to write please and where ?
(scuze for my poor english
Tuesday, May 6th, 2008 at 8:29 pm
I am planning on turning my main site into a magazine-style site, and also keep my current blog linked to it in a folder domain/blog. Is there anyway to use this plugin to do a URL redirect after I move my blog to the new folder? I have five + years worth of blogging and would hate to lose the old links.