Choosing the Right Permalinks for Your WordPress Blog

January 20, 2011 — 117 Comments

Which one?

[This post is part of the Ultimate Guide to Launching a WordPress-Powered Blog series. Check out the rest here!]

This is the continuation of not only the larger series about launching a WordPress-Powered blog but also a continuation of the previous post about optimal WordPress Settings for that new installation.

The topic of permalinks is one of hot debate (at times) and you can surely do your due diligence and scope out the many different and varying perspectives on what is the “best” strategy for permalinks for your blog.

For those that need a quick primer, a “permalink” is:

A permalink, or permanent link, is a URL that points to a specific blog or forum entry after it has passed from the front page to the archives.

In the context of blogging it’s most simply understood as a direct and permanent link to a specific blog post. But, as you can see above, the Default look is a little bit hard to read and remember, right? What does “?p=123″ even mean to anyone?

Nothing, that’s what. So, one of the numerous benefits of using WordPress is that you can declare a Pretty Permalink structure or in laymen’s terms a “more readable” link to your blog post.

But, as with anything, there are a few things you should know:

3 Different Types of Permalinks:

WordPress provides three different types of permalinks for you to use:

1. Default

This is the “ugly” mode of permalinks in WordPress and the always look something like this:

1
http://YourDomainName.com/?p=123

Note the ending . Not too attractive, right?

2. Pretty Permalinks via mod_rewrite

These are typically what’s used and helps make the URL more readable to your visitors. You can choose a number of different “looks” as presented by WordPress:

1
http://YourDomainName.com/category/post-name

or

1
http://YourDomainName.com/year/month/day/post-name

and a few others.

3. PATHINFO

Most of you won’t even know what this means (or even care) but essentially this is just like a “Pretty Permalink” except it adds the actual path to the address which is typically adding “index.php” to the link:

1
http://YourDomainName.com/index.php/yyyy/mm/dd/post-name/

If you’re interested in knowing even more deetail you can download this plugin that will tell you the type of permalink being used.displays the type of permalinks and any detailed information on the internal rewrite rules used by WordPress.

Which One is Right for Me?

Of course the natural question is to decide which one is right for you and your blog. The answer is this: It Depends.

Why? Because you should choose the right type of permalink structure as it relates to these three things:

  1. Content Focus
  2. Information Architecture
  3. Performance Impact

The first point helps you decide which permalink structure to use because depending on your content (and how you’re displaying the content) you’ll be able to choose the right one.

For example, if your blog is more of an archive of research reports that are time-sensitive then you’ll most likely want to choose a permalink structure that has the dates explicitly within the URL. Makes sense, right? Blogs related to events like sports might be better situated for date-based permalinks.

The other point is how you “architect” your blog – that is, how are you presenting the information via internal linking? For example, if you’ve crafted a design in such a way where it showcases different categories plainly and a lot of traffic will be heading toward these top-level categories then you’ll want that in your permalink structure. A practical example of this might be a news-heavy blog or a blog about tutorials covering different types of apps.

The third consideration is that of performance because the simple fact is this: Pretty permalinks tax your server and computing/processing power from your hosting provider.

I will admit that most hosting providers now give a new blog enough computing power for no one to notice but if you’re a performance junkie and/or are having issues with performance (that is, load times for your users) then you might want to come back to this section and do some research.

Generally, it’s not a good idea to start your permalink structure with the following:

  • Category
  • Tag
  • Author
  • Post Name

Why? Because these are text fields (your actual page slugs) and your WordPress application has to figure out whether or not they are actually “Posts” or “Pages” in your system.

Two solutions for those that are performance-inclined is to delineate posts by adding something like “year” or “posts” to the permalink structure:

1
http://YourDomainName.com/year/post-name

or

1
http://YourDomainName.com/posts/post-name

or even

1
http://YourDomainName.com/blog/post-name

I’ve seen it done every single way so you make the call. The criticism, of course, is that it’s not “perfectly pretty” because you have to add one more word to your URL.

So, Mr. TentBlogger… What Do You Use?

For my blogs I’ve chosen to “risk” the performance hit (which is not really a “risk” much at all anymore, besides the fact that I’ve customized my environment) and use the following structure:

1
http://DomainName.com/post-name

And this is the code that I use to do this:

1
/%postname%/

You can see it here:

This one!

Again, I feel comfortable with the performance hit because I don’t have any issues in that department and the way that I’m creating the architecture for my blogs works with this system.

What About My Categories?

Make your categories SEO Friendly too!

Glad you asked! I’ve released a WordPress Plugin here that’ll help you capture (and “fix”) your categories in WordPress for the most SEO-friendly experience ever.

Check it out here!

Other Permalink Settings, Options:

Here are your other options though available with WordPress. I’d suggest thinking about it considerably and making your choice and sticking with it!

1
%year%

What this does: The year of the post, four digits, for example 2004.

1
%monthnum%

What this does: Month of the year, for example 05.

1
%day%

What this does: Day of the month, for example 28.

1
%hour%

What this does: Hour of the day, for example 15.

1
%minute%

What this does: Minute of the hour, for example 43.

1
%second%

What this does: Second of the minute, for example 33.

1
%postname%

What this does: A sanitized version of the title of the post (post slug field on Edit Post/Page panel). So “This Is A Great Post!” becomes this-is-a-great-post in the URI (see Using only %postname%). Starting Permalinks with %postname% is strongly not recommended for performance reasons.

1
%post_id%

What this does: The unique ID # of the post, for example 423.

1
%category%

What this does: A sanitized version of the category name (category slug field on New/Edit Category panel). Nested sub-categories appear as nested directories in the URI. Starting Permalinks with %category% is strongly not recommended for performance reasons.

1
%author%

What this does: A sanitized version of the author name. Starting Permalinks with %author% is strongly not recommended for performance reasons.

Of course, if you need any more information you can check out the permalink section over at WordPress.org.

So, What Are You Using?

Love to hear your thoughts on this and also what you’re using (or going to use)!

Let’s hear it in the comments.

[This post is part of the Ultimate Guide to Launching a WordPress-Powered Blog series. Check out the rest here!]

John

Posts Twitter Facebook

I'm passionate about startups, blogging, and human capital. I love what I do and who I get to work with. I am incredibly blessed.


117 responses to Choosing the Right Permalinks for Your WordPress Blog

  1. Agreed, I use /%postname%/, I think it the the neatest way for any normal site.

    I would think for a news site dates would be important and maybe a church site could utilize the /%category%/%postname%/ format.

    • brad, apparently you didn’t read the entire post (which is cool, i guess)…

      i mention that in the post explicitly:

      For example, if you’re blog is more of an archive of research reports that are time-sensitive then you’ll most likely want to choose a permalink structure that has the dates explicitly within the URL. Makes sense, right? Blogs related to events like sports might be better situated for date-based permalinks.

      The other point is how you “architect” your blog – that is, how are you presenting the information via internal linking? For example, if you’ve crafted a design in such a way where it showcases different categories plainly and a lot of traffic will be heading toward these top-level categories then you’ll want that in your permalink structure. A practical example of this might be a news-heavy blog or a blog about tutorials covering different types of apps.

      thanks dude.

  2. I’m currently using the date/name format since it seemed the best of the standard options. I like the look of the domain/postname option, but presumably changing permalink structure after being active blogging for a while is problematic. Meaning all existing internal and external links will break, right?

  3. I am using %postname% for my small business clients sites and for most of the other sites that I make.

    I really don’t do anything with time sensitive sites where there is a higher volume of time sensitive posts so have not had to go with that option yet.

  4. One thing to add: double check for typos in the Custom Structure field if you change your permalinks config and then test out your change by accessing different posts/pages as soon as you make the change.

    I’ve seen several WordPress installs get totally messed up because someone typed in (or copied/pasted) something that wasn’t quite right.

  5. I use the same you use.
    After changing it that way I saw an increase in traffic…

  6. Hi

    I want to change my permalinks structure without having the complete site with 404 errors.

    I have %postname% and want to change that to something else, so new posts have date and post or date, category and post.

    if I just change it, my 5000 articles will go to 404 instantly. I need to change them because I am starting to have duplicate titles and with a 10 year old website is not easy to not have those.

    How can I change it and make wordpress knows that the old ones now have the new structure and redirect there ?

    Thanks.

    • John Saddington January 21, 2011 at 3:03 PM

      that’s not true if you’re using the newest versions of wordpress. you can change permalinks without it breaking.

      you could even do a quick test late one night and see for yourself.

  7. My question is does it retroactively change your previous posts? This is something I’d like to do on one of my side projects, but there is NO WAY I’d want to lose inbound links from other sites if it changed the earlier links.

    • Yes, you can do this, but you have to change the .htaccess file. Try this at your own risk, but this is what I have:

      RewriteEngine On
      RewriteBase /

      # Rewrite /year/mo/post-slug.html format links to /post-slug.html
      # old: RewriteRule ^\d{4}\/\d{2}\/(.*) /$1 [R=301,L]
      RewriteRule ^\d{4}\/\d{2}\/(.*?)(\.html)?\/?$ /$1.html [R=301,L]

      I did not lose any of my external links.

  8. I use the same URL structure you use. The reason us two-fold: (1) I want to make it easy for my readers, and (2) I don’t want to date my posts. Most of my content has a long shelf-life. When you include the date in the permalink, and that link is more than a few months old, many readers will assume it is no longer relevant.

    This is also why I moved the date of the post on single.php to the bottom of the post.

    • Glad you mentioned that. I have been using the date format since it seemed more logical in keeping track of everything.

      I see your point, because I do look at the date of articles I am reading and determine if I want to keep reading them or not based on the date. Don’t know why I didn’t see that logic for my own blog.

      Thanks for the insight.

  9. If I change these settings, does it leave all previous posts with their original structure? I ask because I’d hate to lose incoming links because the structure changed. It’s relevant to on my my side blogs.

  10. I’m using /%category%/%postname%/ on my work blog.

  11. I blindly settled for the default permalink structure when I first discovered WordPress.

    Later I learned the impact of permalinks on SEO and changed it to a custom structure. However I had to use a redirect plugin to avoid broken links, just adding another load on the server…

  12. Just using the straight /%postname%/ for all my blogs.

    Though it might risk a “performance hit”, I actually like that it makes pages and posts indistinguishable from one another.

    And I second (or third) the comment above about using dates in the to permalink causes people to dismiss a post for being out of date without even reading it.

  13. I use two formats, depending on the site.

    For my business sites I use %postname% because they’re not blogs, it’s just a website and dates are irrelevent

    For my personal blog, I use year (and sometimes month) as well. Why? because I keep getting duplicates otherwise, like a yearly “Merry Christmas” post or “Happy New Year”.

  14. I use the same. %postname% Mainly because I was looking for simplicity and the ability not to date most of my content since a lot of it has a longer lifespan. If I see a post getting ongoing traffic and the info that I shared on it becoming irrelevant then I’d rather go back into the post and update its content versus loose the link juice.

  15. might be a dumb question (but I’m new to this)… Does changing to a pretty permalink have any effect on searchability via search engines?

  16. Moved from date/postname to just postname. Definitely cleaner…

  17. I use the same as you, been doing it for about 8 months now, I believe that it’s the best SEO Friendly one to use :)

  18. This is really helpful information. Thanks for clearing up some things for me!

  19. I’m changing from the “Day and Name” to Custom “/%postname%/”. Maybe it’s a cache thing, but the posts on my first page of the blog still only reference the old links. A couple actually work with the old date/name file structure and the others show an Error 404. Thoughts?

  20. Hi John, awesome thoughts, just a doubt, I would like to change the permalink from date to custom post name… but wondering if that would cause broken links? If so please tell me if I can solve that? Thank you.

  21. Sweet! Thank you for this amazing tip!

  22. This post was very helpful John. Very easy to do. I appreciate the simplicity in which you write to help others becoming better bloggers.

  23. Okay – quick question (hi).

    I’m putting together a site that includes a calendar of local events, and am using the Event Calendar Pro plugin. This question isn’t about the calendar, per se, as about the permalink structure for each event.

    The default permalink structure is:
    http://crossroads.cashcowcard.com/event/%postname%, I think.

    I have been editing the permalinks to be more like:
    http://crossroads.cashcowcard.com/event/victoria-tx-library-storytime-green/

    Does that make it more likely that, when someone searches for “victoria tx library storytime,” my site will pop up? Or am I wasting my precious keystrokes on something that really doesn’t make much difference?

  24. This is a delayed reply, but I tried changing my permalinks to the same format you use, because like Michael Hyatt, my posts aren’t time-senstive, but it didn’t change the links within existing posts (like when I referred back to something I had previously written.) I’m an amateur when it comes to tech stuff, so any help would be greatly appreciated. I’m using WordPres 3.0.5

    I tried reading through the comments, and saw the one from Michael about changing the .htaccess file, but since I am really not advanced at this, I didn’t want to try that, without knowing that’s really what’s needed.

    Thanks so much for any help!

  25. John,

    I know that I’m entering the discussion late in the game, but is/are there any thoughts on including extensions as part of your permalink structure? For example:

    /%postname%.html

    I saw that Michael Hyatt had them in his permalink structure.

  26. if i change my peramalinks will it disturb google to crawl

  27. I posted this question in the permalink plug in question, but I think the issue isn’t with the plug in, but with the /%postname%/ that I changed it to. When I look at my google webmaster tools it shows 424 links “not found” – 404 error….Yikes! I had no idea..i”m using the most current version of word press as well. Any thoughts..?

  28. I just checked a ton of those broken links, and if I remove the date and change the post to /blogTitle they all work…looks like the links didn’t change when I added the /postname/

    any ideas on how to fix this..?

  29. John,

    Like you I use the /%postname%/ structure. I have read other blog posts that advise against this due to the performance issues that you mentioned but in that some of the SEO guru’s I know recommend and use the postname permalink structure I decided to sacrifice performance for potential traffic and seo. That being said, for those of use not using a dedicated server or content delivery network, a plugin like W3 Total Cache would help (as if you’ve written in another post.

    Thanks again for posting great content.

  30. Dear John,

    Greetings from Medan, Indonesia. Im currently using the year/month/postname structure. IF i change it now from the wordpress will that be any ERROR issue? will they still be posted in Monthly basis?

    thank you and great blog u have here,
    indrahalim.com

  31. My question is, if I change my permalink, then will all my internal links back to my blog be broken? I wish I had started a different way, but since I didn’t I am scared to change.

  32. I found this post and the others which led me here very helpful. I’ve been beating myself up wondering if I selected the right token for my setting (/%postname%/). I feel much better now. Thanks

  33. Dewitt Robinson June 26, 2011 at 11:38 PM

    I’m going to start using the post name.

  34. Every time I read a post of yours I end up making a change to my site. This is such fantastic stuff! Thank you John! I have yet to, and probably never will, find a site that is so helpful and presents the technical side of all of this stuff with so much wit and wisdom!

  35. I am having lots of issues with duplicate content when I log into google webmaster tools.

    Google is showing two versions of my pages. One with a / and one without a slash. I did some reading and someone pointed me to this page http://www.michaelbubbo.com/blog/2009/best-wordpress-permalink-structure that suggested using /%postname% (with no trailing slash) or “even better /%postname%.html since google prefers webpages that end in .html.”

    I looked on google webmaster and all of their examples ended in .html like “http://example.com/fun.html” Just curious what the thought is on this?

    I’d like to someone clean up all of this duplicate stuff with two different urls. One with no trailing slash and one with.

    Curious if anyone has any ideas?

  36. I would love to use only postname.. But I fear that the site will be broken for one day and that I will lose all the shares from Stumble and Facebook. Will this be a issue? Do anyone here have experience with losing shares and so on?

  37. Greate Series of articles. I have to say I like the way you weighed the pros and Cons of the various Permalinks.

    I like the defauly Permalink because as you said they are designed for speed and don’t slow the server down.

    In fact I’ve implemented your recommendation on my blog http://www.fingermonkeywire.com

    Thanks!

  38. I’m thinking of switching to “/%postname%/” (currently doing year/month/day/postname, but most of my content isn’t that time sensitive). I noticed, however, that the permalink to this post is ./permalinks/, not ./choosing-the-right-permalinks-for-your-wordpress-blog/. Do you have it set as /%postname%/ in the settings, but on each new post, you edit the permalink to the keyword of that post? I do like the idea of keeping the links short and sweet.

  39. Just a heads up that the performance issues associated with “/%postname%/” have been fixed in WP 3.3. In fact, there’s now a “post name” option in the permalink settings.

  40. Hi John,

    So I changed my URLS from http://www.website.com/01-12-2012/example to
    http://www.website.com/example, but now most (100s) of my external and internal links are broken. I installed the Redirection plugin that you recommended… now what?! Thanks.

  41. `For many bloggers permalink setting is very confusing !! I am using your SEO Categories plugin and I am very happy with that, as my blog is more SEO friendly in terms of URL now…

  42. All right (I said this because I finally got how both the /%postname%/ permalink and the plugin work. I’m a brand new blogger and I’m following your Ultimate Guide to the letter while listening to some pretty good blues (and some Gogol Bordello, nobody is perfect).

    Got a question, thou. I see that the permalinks for your posts do not match exactly the title of the post, they’re like keywords, are they?. How do you set those?

Leave a Reply