How to Change your Permalink Structure Without Breaking your Links

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.

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).

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%/

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’.

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?

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.

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

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.

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.

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.

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.

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.

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?

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).

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?

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…!

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.

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?

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.

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.

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?

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).

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

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.

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!

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?

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.

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.

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

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.

Wish your site was as fast as this?

Do It With WordPress is proudly hosted by WP Engine, the very best WordPress hosting that money can buy.

Aside from being blazing fast, it's very secure, has a staging area to test changes before making them live, automated daily backups, malware scanning, stellar support from WordPress experts... It's just everything that you would want from your host, and more.