How to Change your Permalink Structure Without Breaking your Links

Manage your links in WordPress

Permalinks are the part of each web address that comes after the domain name, pointing to a specific article on that website and they serve a few purposes:

  • When correctly composed, they give people an idea of what your article is about, just by seeing the article title in the web address.
  • They do the same for search engines, helping them to ascertain the topic of a page just by reading the URL.
  • Lastly, they provide a permanent location, which people and search engines rely on to be able to find your content easily.

In that sense, permalinks are like your postal address: they’re a unique marker that is permanently tied to each of your articles.

In the same way that you sometimes move house, you may want or need to change your permalink structure. The most likely reason is that you started using the default WordPress permalink structure and now want to tweak it.

To carry on the parallel, when you move house, you need to let people know so that they know where to find you and send mail. The same is true when you change your permalink structure – you need to let your readers and search engines know where you’ve moved your articles to.

Default and common permalink structures

The default permalink structure that WordPress uses is

where 123 is the post ID. This isn’t really advisable, because neither search engines, nor people get any clue of what the article is about until they open it.

Under the Settings > Permalinks menu, WordPress also offers up some other permalink structures that you can choose from, including

and

which include the date, so that readers can get an idea of how old the article is from the URL. On websites where current topics are the focus, this may prove more useful.

In my opinion however, sites like mine, where the information is more ‘timeless’, having the date in the URL is not really worthwhile, so my preferred format is

The syntax for this permalink structure is:

However, you don’t want to change your permalink structure before you’ve made sure that you set up the redirects, so that anyone going to your old addresses is forwarded to your new addresses. It’s like telling the Post Office to forward your mail to your new address when you move house.

How to redirect traffic

There are a few different ways that you can redirect traffic. However, the cleanest way to do it is by setting up a 301 redirect, which serves two functions:

  • It forwards users who enter the old address to the new address, and
  • It tells search engines and browsers that visit the old address that the article has permanently moved to the new address, so that they can update their indexes and bookmarks automatically.

This way, search engines will automatically update the addresses of all your pages that they have indexed, so you’re not losing any headway with the search engines.

Setting up the redirects

There is an excellent plugin called Advanced Permalinks that handles all of this work for you behind-the-scenes. Once you’ve installed it, the set-up is so easy that you’ll be wondering whether it has been done correctly.
Migrating your Old Permalinks to your New Permalinks

  1. Under the Settings menu, select the Permalinks section. You’ll see that there are four new tabs at the top of the page (Advanced, Posts, Migration and Debug).
  2. Make note of your existing permalink structure – this will be shown in the text box next to the custom option, even if you’ve selected one of the preset options. Copy this syntax as you’ll need it in the next step. If you’re using the default permalink structure, it won’t show up, but the syntax is /?p=%post_id%/
  3. Now head over to the Migration tab – this will allow you to specify any number of old permalink structures (you can change your permalink structure as many times as you like, but I don’t recommend this). Paste the syntax from the previous step into the text box called ‘Old Permalink’ and hit ‘Add’.
  4. Now you’re free to change your permalink structure to your new structure on the Defaults tab. The plugin will create a dynamic 301 redirect, that redirects traffic arriving at any of the old syntaxes to the current permalink structure, whatever it may be.

That’s it! It’s probably wise to submit your site to search engines to be crawled as soon as possible so that they get your updated permalink structure ASAP.

Moving to a new domain as well

If you’re moving your WordPress site to a new domain and want to change your permalink structure at the same time to get a fresh start, you’ll want to follow the above instructions on your new installation. As for the old installation, you’ll want to follow my guide for ‘Moving your WordPress site to a New Domain Seamlessly‘, paying particular attention to step 9, which creates a redirect from your old site to your new site.

If you then follow the 4 steps above on your new site, you’ll essentially be creating two redirects: anyone arriving at your old site will be redirected to the same permalink structure on your new site. However, Advanced Permalinks on your new site will redirect you from the old permalink structure to the new permalink structure. And it will do all of this before you can bat an eye.

Have you given this a go? What was the reason that you changed your permalink structure?

66 thoughts on “How to Change your Permalink Structure Without Breaking your Links”

  1. Dana says:

    I just have plan to change my permalink instruction but worry about the effective of SEO. Thank you for your tips that help !

    1. Changing permalinks is one of the easiest tasks to undertake if you do it properly. The 301 redirect instantly informs search engines where your content has moved and if done correctly, you won’t be penalised at all.

      1. Dana says:

        I just afraid that when I change the URL structure, it will lost on search engine ranking results.

        1. Well I can’t do much more than tell you that it won’t. Do a Google search for 301 redirect SEO and see what it says

  2. Dana says:

    Thank you for your suggestion. I will make a change for now.

  3. Is it possible to change a permalink but transfer the number of Facebook “Likes” it has received? Thanks.

    1. I’m afraid not. Facebook like counts and tweet counts are tied to unique URLs. Even if you 301 redirect, counts will be lost. Unfortunate side effect. I just went through it with changing my domain name on this site

      1. Thanks! (2 months later, hehe) :)

  4. AstroGremlin says:

    Hey Dave! Just getting back to your site to get some more well written instructions. I may have mentioned this: Yours is the best technical writing on blogging I have found. It makes my head hurt sometimes because it is the real deal .

    I’ve been changing my permalink settings for months, going back and forth with the date setting mostly. Went to “pretty” permalinks after writing some “ugly” posts that still get some good organic search hits. Figure I’ve messed it up pretty thoroughly, so just installed Advanced Permalinks and will fool around with that for awhile, lol. Since I have very few Facebook likes, I fear little. Sincere thanks for the clarity.

    1. First of all, thanks for the kind words. Nice to feel appreciated.

      Secondly, had you been changing your permalinks without 301 redirects in place? That’s unfortunate, but all is not lost because you can still set up the redirects and capture any traffic still going to indexed invalid addresses. Hopefully, you catch it before losing too much traffic, or standing. Use Google Webmaster Tools to see where 404 errors are popping up.

  5. Alex says:

    Thanks so Much for this, I still have problems re-directing my default tags and category pages to the new ones which I have set. The posts now work fine. Any Ideas will be much appreciated.

    1. If you change the category and tag base in your permalinks setting, everything else should update automatically, especially if your permalinks update is already working for posts.

  6. Jeff says:

    FYI: There is a statement on the plugin authors homepage saying he is no longer updating or supporting it. http://urbangiraffe.com/plugins/advanced-permalinks/

    1. Thanks for letting us know John. As it stands, I still have the plugin active and it still works for me and hopefully it continues that way.

  7. I installed the plugin, set the old permalink structure on the migration tab and then updated my permalinks to use just /%postname%/, Everything worked fine except the category pages which brought me 404 errors.

    You say above to change the category and tag base in your permalinks setting, but there was never anything there to change. I do not understand.

    1. Olfa says:

      I have the same problem how do we fix it?

      1. Have you tried changing (or entering, if nothing there) a category base in Settings > Permalinks? How does that work for you?

  8. Boaz says:

    Very nice. but don’t work for me, my permalink setting is default, i.e. post id, so i can’t see what the old format is to put in the migration tab…any suggestions?

    1. Well, you need to know what your old permalink setting is, before you change it. If you’ve already changed it, you could do a quick search for your site on Google and if it hasn’t updated it’s index of your pages, look at the URL and you should be able to work out what the old permalink structure was. It shouldn’t make a difference that your site is MU though.

      1. Boaz says:

        it was post_id, changed to custom. I get read posts, but when I click on a category i get nothing was found for the blog category message…any advice?

        1. Do you know what it used to be and what you want it to be? Check Google for a cached category page to see what the URL used to look like.

  9. Boaz says:

    i.e. old permalink is /%post-id%/, put it, changed the permalink and…does not work…btw, my site is mu

  10. Kyle Travers says:

    I’ve used WP’s default structure, so do I type in “www.knot-dresses.com/?p=123″ as the old? It doesn’t show a %xxx% for it. ?? Thanks so much for this post as it has helped me immensely to move my website to a better domain for seo – I’m just on the last step for improving my permalinks.

    1. Very good question. I’d have to try a few different things, but try putting the old in as /?p=%post_id%/ and see whether that works. Let me know

      1. Kyle Travers says:

        That worked! Thanks so much!

  11. Darrell says:

    Hi Dave, thanks for this information. I have one question: I’d like to change some of my headlines (title tags), which will change the url, but I have a lot of backlinks built to all of my url’s. If I change a title and use a 301 redirect to point to the new url, will I lose the seo benefit of the backlinks pointing to the old urls?

    1. Firstly, if you change the title of a post that has already been posted, the permalink should not change. WordPress doesn’t let it, unless you specifically change it, to avoid this issue. Secondly, you won’t lost any SEO benefits provided that you have a 301 redirect in place. Google and all other SEs will treat the new URL as the old (and attribute all old backlinks to the new URL).

      1. Darrell says:

        Oh ok. I assumed changing the title would change the permalink / url. So if I am only changing the title and the url remains the same, do I still need to set up a redirect? Or is a 301 needed only if I want to change the permalink structure?

        1. No. If the post is already published, the permalink won’t change (try it on one and check). You’ll only need to do the 301 redirect if you change the permalink structure.

          1. Darrell says:

            I did check it and you are absolutely correct. Thanks a lot!

  12. Recently I’ve changed permalink structure for my site
    /%category%/%postname% to /%postname%
    Through this article I came to know about 301 redirection, do I have to set that manually? while I check in browser typing old url I automatically redirected to new url with the same page, So it’s necessary to set 301 redirection…?
    Thanks for this article…!

    1. This plugin does the 301 redirection for you, which is why when you put the old URL in your browser, you are automatically forwarded to your new URL. Sounds like everything is set up correctly.

      1. Codeirsh says:

        What Ganesh was talking about is that his blog automatically redirects the old permalinks to the new structure without using the mentioned plugin. I have tried that myself and I think wordpress automatically redirects the old posts after permalink change.

        1. Hmmm, I’d be surprised if it did, but that may have been a development that I wasn’t aware of. I’ll do a little research and see whether WordPress does this automatically now.

  13. Stephen says:

    Advanced permalinks plugin is no longer supported (and in fact breaks category links in WP 3.3).

    Can anyone suggest another way to redirect permalinks? Yoast has a htaccess rules generator here but it doesn’t seem to work for me!
    http://yoast.com/change-wordpress-permalink-structure/

    1. I just saw an update of Advanced Permalinks come through just the other day (must still be supported). Check to make sure that you’re on the latest version.

      1. Stephen says:

        Yep you are right it’s back! Must have been down momentarily while the author updated the plugin.

        I got Yoast’s tool to work – it requires .htaccess edit but it should put less load on the server than a plugin. If anyone else uses it, the edit should go just below RewriteEngine On

  14. Matt says:

    FYI.

    Latest version of Advanced Permalinks 0.1.21 installed on WordPress 3.3.2 has been breaking the RSS feed.

    http://www.feedvalidator.org returns a “XML Parsing Error: no element found Line Number 1, Column 0″ error.

    It’s happened on multiple sites, all using different hosts and themes. If you’ve had luck with the plugin, congrats, but be wary because it’s caused a handful of issues in the past when upgrading.

    Just wanted to pass along the info.

    1. The advice is much appreciated Matt. Always keen to carry on the discussion and have people report on what they’ve found.

  15. Sid says:

    Dave, I can confirm the plugin no longer works on WordPress 3.4.1.

    1. That’s a shame. Thanks for the update though. Out of interest, what’s the issue?

      1. Sid says:

        After a day of Googling, I have figured out the problem may not be with the plugin but with WordPress 3.4.1.

        Link: http://wordpress.org/support/topic/permalink-structure-no-longer-works?replies=41

        It’s a shame that 301 redirecting of older permalinks on 3.4.1 is not possible at the moment.

        1. Well that’s encouraging. Thanks for the update Sid. Would be good if the plugin does indeed still work.

  16. Kareem Salameh says:

    Hi Dave,

    Thanks for yet another great post.

    It appears the whole permalink debate is not very straightforward and requires a fair bit of thinking.

    For example, If I run a blog which presently has one post per day (done by me alone) but then say I intend to have multiple authors added within a year and have the blog realise 10 or 20 posts per day, wouldn’t /%postname%/ be problematic? Would you then recommend a structure with a date?

    Many thanks!

    Kareem

    1. It’s purely preference. There is no performance change between the two permalink structures and it’s merely a matter of taste.

  17. Bryan says:

    Whoa! This worked perfectly. I’ve tried a few other permalink redirect plugins that failed, but this plugin was a snap to set up.

  18. Hi Thanks for your valuable information.
    I am currently having one problem. i first had permalinks as “/Postname”
    and now i changed to “/postid/postname” . Now google has indexed both types of url in Google Searches. which is creating a mess in webmaster tool with duplicate meta title and description.

    Please Help Me Fix This.

    1. Well, if you follow these instructions, then it will create a 301 redirect on your old content, thus attributing all of your old links to your new ones. If you made the change without doing this, revert back to the old permalink format, then change using this procedure and you’ll be covered.

  19. Mattis Weiler says:

    Hey Dave, thanks for the great insights and your commitment to answer each comment, impressing (support can be quite sad these days ;))

    1. I would like to relaunch my website, but have changed and minimized the entire url structure on the new site. Since various links from the old website are still linked up from forums etc, would if be possible to redirect those urls to the corresponding new ones, since the original Page/Url won’t exist anymore?

    2. While all my urls on the new website would be keyword targeted, i think it would make the most sense to internally link between pages by using the /?p=123 format, since this would allow me to quickly change the url name of a certain page without having to worry about breaking any links. Do you agree?

    Thanks,
    mattis

    1. Mattis,

      Thanks for the compliments :)

      1. Absolutely. This is exactly the kind of issue described and remedied by this post. Just redirect your old permalink structure to your new one and all old links (from forums or wherever) will be 301 redirected to the correct URL.

      2. I disagree. It sounds like you’re planning to regularly change the permalink of the page to different keywords, perhaps based on its performance. I strongly discourage that. It’s a permalink for a reason: it’s intended to be permanent. You shouldn’t meddle with it. Making sure the content is unique, worthwhile and engaging is far more valuable than merely tweaking the URL. Keep the URL constant and using the linking tool to quickly and easily link to other pages on your site (using the correct URL).

  20. Mattis Weiler says:

    Hey Dave thanks for the quick reply ;)
    1. got it
    2. I don’t plan to change them often, but it might be that my client wants to change one or two url names over time when i am gone, thus i would like to set up so they can’t break the connection.
    Thanks,
    mattis

    1. Even if that’s the case, I would recommend using a tool like Redirection to manually create 301 redirects in these instances. Then the connection won’t be broken. I don’t advise using “ugly URLs” just to point to the right page. This is a better method if you/your client insists on changing the permalink.

  21. Mattis Weiler says:

    Alright Dave,
    then I’ll go with that ;) Thanks a ton for your advise, I truly appreciate it.
    Have an awesome day!

  22. Dedushka says:

    Hi there!
    They said this plugin doesn’t want work with WP starting from 3.4.1. What should I do to make it work or what can I use instead?
    Have tried this plugin with WP 3.5 – not working.
    Thanks!

    1. You could try a plugin like this, which does the same task and is reported to be working with 3.5

      1. Dedushka says:

        Thank you SO much! It works gret with 3.4.1.
        Many thanks!

  23. Justin says:

    Thanks so much! works with 3.5.1 WP version. My slug was getting long and I want to move to the /year/month/ID structure but all my links was 404. This fixed it! Thanks!!

  24. Mike says:

    HI – I saw this article a little too late as I changed my permalink structure without knowing how that would affect my website (as stated so elequently above). I did loose my Google ranking and I am hoping that “time” (waiting it out) will eventually heal this??? I’d appreciate your input. Thanks!

    1. Mike,

      It’s OK – so long as you have implemented the redirection method now, Google will pick up on these articles having moved. Hopefully there wasn’t too much of a gap between changing the permalink structure and enacting the redirects?

      1. Mike says:

        Hi Dave,

        Thanks for your response.

        No, I never did that and it’s been over a month now so…?

        I also don’t remember “exactly” what my old permalink settings were and I know I would need to know that.

        Anyway – that’s why I was asking if they might repair themselves overtime???

        Thanks again.

        Mike

        1. Mike,

          Well, it would repair itself over time, but who knows how long that might take. A way around this would be to look at Google’s index of your site and look what kind of URLs are indexed (which will indicate your former permalink structure). The sooner you can do that and implement the redirect, the better.

  25. Hoang says:

    Is the plugin still work? It has not been update for over 2 years now so I am a bit worry! Also, it’s reported that redirects are 302, not 301!

    1. I’m not certain. You’d have to test it out. I was actually looking into this just last week, and I saw an alternative option from Yoast, which may be worth looking at: https://yoast.com/wordpress/plugins/permalink-redirect/

  26. Dear Dave Clements,

    I am searching about the permalink redirection article from 2 months. I have tested nearly one dozen plugins and scripts and .htacess codes also. This testings affected my Blog rating and configuration. Suddenly i followed your method. 100% working. My 3 years old blog showing some Google update problem. Now i came out with your method. This redirect method did not affect on my images. Everything is good. Thank you…. Thank you so much.

    Regards
    Satish Kumar Ithamsetty

  27. HI Dave. I changed my permalink structure from category-postname to just postname using the Yoast redirect generator and adding the code to my .htaccess file. Post redirects work fine but now category, tag, and post page navigation are all broken leading to 404 errors. Any idea on how to fix this or who to go to to get it figured out? I can’t find anything on the Internet. Thanks

    1. One thing you might try is to go to your Permalinks settings and just click on save to flush your rewrite rules. Beyond that, I don’t know how Yoast’s generator works, so I can’t tell you offhand what the issue might be.

Leave a Reply