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
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?