The Ultimate Guide to WordPress Permalinks

WordPress permalinks

As you will probably know or have read around, WordPress is one of the best Content Management Systems you can use when it comes to SEO.

It is very well optimised out of the box, plus you can also find some excellent plugins like WordPress SEO by Yoast that help you fine tune the SEO aspect further. One important consideration when building and setting up a new WordPress site is definitely your URL structure, better known in WordPress as the permalink structure.

It is a fact that URLs are very important for SEO, so you should dedicate some time to deciding what would be the best structure for your site or blog.

Default is Rarely, if Ever, Good

The default permalinks are horrible in terms of SEO, as they make no semantic sense. Here are some examples of default permalinks:

  • Post Permalink: example.com/?p=123
  • Page Permalink: example.com/?page_id=123
  • Category Permalink: example.com/?cat=123
  • Tag Permalink: example.com/?tag=tag-name
  • Archive Permalink: example.com/?m=201212 or example.com/?m=2012

Those numbers don’t mean anything to humans, neither do they mean anything to Google and other search engines.

They do mean a lot to WordPress and its database as they are the parameters used by WordPress to find the data within its database, but we’re here to optimise for SEO, so we need something better.

Here are some other in-built permalink options you can use:

Default wordpress permalink structures

Date-based permalink structures are not recommended as they will most likely decrease click through rates on older articles (people generally prefer reading fresh content over old posts).

The numeric permalink structure on the other hand is just a bit better than the default structure but still doesn’t offer any usability or SEO benefit.

The Ideal Permalink Structure

The permalink structures I prefer to use on most of my WordPress sites are the following two:

  1. /%category%/%postname%/
/%category%/%postname%/

or

  1. /%postname%/
/%postname%/

The /%postname%/ structure is now one of the in-built structures that come with WordPress so you can just select it from the Permalinks settings page (just click the radio button for the option ‘Post name’).

These two permalink structures are the most accurate descriptions of your content, and are perfect for search engines and human visitors alike. The question is whether to use one or the other.

In previous versions of WordPress it was recommended not to use the /%postname%/ permalink structure due to the possibility of performance issues relating to the way in which WordPress fetched posts.

However this issue has been fixed in WordPress 3.3 and you can now use this permalink structure with no worries. So, once we can use either one or the other freely, here’s when to use one or the other.

Let’s start from the /%category%/%postname%/ structure. In this case your permalinks will look like this:

  • Post Permalink: example.com/cat-name/post-name
  • Page Permalink: example.com/page-name
  • Category Permalink: example.com/cat-name
  • Tag Permalink: example.com/tag-name
  • Archive Permalink: example.com/2012/12 or example.com/2012

Whether you use the /%category%/ part of the permalink is largely a question of flexibility.

On the pro side you have a more structured URL and both the user and search engines can better quickly identify to what category a post belongs to, but on the other hand it might become messy if for example you put posts in more than one category.

So if you always stick and will stick to one category per post, you could use the /%category%/%postname%/ permalink structure.

I myself find I need to put posts in more than one category so I use the /%postname%/ permalink structure most frequently.

It’s your call as to which is more ideal for you, but both are ideal permalink structures.

Removing Category and Tag Bases

If you visit your category and tag archive pages, you will notice that the URL includes /category/ as its base.

For example: http://www.wpmayor.com/category/themes/

We don’t really need that “category” or “tag” in the URL, so you can easily remove it using the WP No Category Base plugin, or even by setting the “Strip the category base  from the category URL” option in WordPress SEO if you are already using that plugin.

Changing Permalink Structures

If you’ve already got an established site, and would like to change the permalink structure, you should first ask yourself if it is really necessary.

Unless you have a very good reason to change I would suggest to stay with the permalinks you have in place, so as not to risk running into any SEO issues.

A valid reason would be that you started off with the default WordPress permalinks and now realised that they are not SEO or user friendly at all.

For example, having a URL structure like www.domain.com/?page_id=123 for your ‘WordPress Services’ page is not ideal at all. It would be much better if it looked something like www.domain.com/wordpress-services. This looks better and also contains your keywords in the URL, so better for SEO as well.

So how do we change our permalink structures without a negative SEO impact?

The key is to use 301 redirection to redirect the previous URL structures to the new ones. The code “301″ is interpreted as “moved permanently”. 301 redirection is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it should preserve your search engine rankings for that particular page (it transfers over almost all of your link-juice to your new URL).

In short, it’s the best option when changing permalink structures.

Failing to use 301 redirection will result in 404 Page not found errors when someone visits one of your site’s pages by following an old link. Since all your backlinks would be using the old permalink structure, not having 301 redirection in place also means that you will use all that link juice, therefore you will have a major negative hit in search engines.

So what we will need to do for an effective permalink structure change is this:

  1. Have a redirection system in place
  2. Change the permalink structure

Once you follow the two steps you shouldn’t have any problems with broken links or SEO at all.

As a redirection system you can use Joost de Valk’s redirection tool, it is quite straightforward to set up. If you prefer a more automated plugin solution, I can recommend the following two free plugins:

Both plugins are created by Automattic developer John Godley, and they can effectively help you set up the 301 directs with minimal hassle.

So there you have it, you should now have a very good idea about what permalink structure you should use and how to set everything up. If you have any questions, just drop a comment below.

Creative Commons image courtesy of Yandle.

Access, manage, update and backup all your WordPress sites from one powerful dashboard

Sign up - it's free!
post a comment

20 Comments

  1. Phil Amery says:

    Hi,

    a valuable and informative article indeed
    still it seems like I can hardly solve my issue
    here is in brief:

    this is the structure I want to achieve:
    Blog category pages:
    domain.com/blog/catagoryname1/
    domain.com/blog/catagoryname2/

    Blog post pages:
    domain.com/blog/postwhatever1
    domain.com/blog/postwhatever2

    I simply tried several combinations under Permalink settings but simply couldn't achieve a fully functional version.

    Here is my last setting which ended up in working pretty well but got 404 pages for the correct blog post URL:

    Custom structure: /blog/%postname%
    Category base: blog

    So the idea is to make my blog categories accessible under the /blog/ folder and all posts under the /blog/ root

    I want to follow a logical hierarchy but now I simply got stuck.

    Would appreciate any valuable suggestion or tip.

  2. David says:

    Hey, there! Building a WP site for a client, had a category (like "…com/examplename/"), but wanted to rename a page to that slug, so we deleted the category and tried to change the permalink to "…com/examplename/". That doesn't work. WP automatically changes it to"…com/examplename-2/". Can you please help? :(

  3. ayyan says:

    Can we use tag id in permalinks? if use, please give any example.

  4. indranil says:

    how can i make the permalink as mywebsite/username

  5. saaied says:

    i'm think this premalink is best … and use in my website

    /%category%/%postname%/

  6. Santiago says:

    After read all your post, i don't know if you still could recommend a permalink change to /%postname%/ even if is in a news and timeless content site planned for too many posts for the future (with a 5 or more posts per day planned). I'm worried about the perfomance of the site with this change in the future for that quantity of pages. If i should make a change i wanna make it now.

    Thanks in advance for your valuable time!

  7. Paul says:

    I've always heard that the best permalink structure is the one that will give you the smallest URL, which is why I always choose just the post title in the URLs.

  8. Watch Teller says:

    Hi Jean Galea and anyone,

    I had problem to setup /%postname%/ permalink structure, my theme (with theme sample data and image)only allow default permalink if not all my page and post shown "404 page not found" except "Home" page. What cause this happen??? Is it cause by theme's sample data and image???

    I would like to setup /%postname%/ permalink structure, HELP???

  9. Michael says:

    Hi Jean,

    I really love the quality and depth of the posts at managewp.

    I had a quick question — You mentioned that you follow the /%postname%/ permalink structure. But, your post name and your permalink are not the same. Is it possible to change the title of the post after the URL is fixed? Can you please help me understand?

    Thanks,

  10. redLodyas says:

    Just started using ManageWP, and ended up here from the admin panel, starting to like this ManageWP.

  11. Gregory Fu says:

    I considered using "/%category%/%postname%/" once, but had a concern: When a post is assigned to more than one category, which one will be used and are there any side effects?

    Can anyone shed any light on this?

    Thanks, and thanks for the post!

  12. UncatCrea says:

    Thank you for this article.

    I am happy to see that the article is part of the one correctly assessing the multi-categories topic.

    2 things came to my mind when I read it :
    - May you should point the fact that the hierarchy of pages will be visible in the page permalinks (?)
    - Regarding SEO, having the ID in the permalink (eg. %id%/%posname%) is a very good idea as it will allow WordPress to create 301 redirections in case a permalink is changed (and in fact, from my experience, it is good for performance too)

    Finally, it would be nice to have a second part on CPT.

    Again thanks.

    - Benjamin

    • Jean Galea says:

      Thanks for your comments Benjamin, performance wise having the id in the permalink should be the same as having no id, and as far as I know WordPress will still create redirections even without the id.

      A second part on CPT is a good idea indeed, thanks.

  13. Very interesting post! I found it useful! Thank you