WP Permalink Structure

23 replies
  • SEO
  • |
What structure is best for WordPress permalinks? I've seen some using just `/%postname%/`, but the codex recommends against it for performance issues. Will I get just as much SEO-love using /%post_id%-%postname%/ or /year/month/day/post-name?

What do you use on your blogs?
#permalink #structure
  • Profile picture of the author FredJones
    For SEO purposes, I recommend using a title in which you have the keyword inside the post permalink (assuming that the KW is in the title).
    {{ DiscussionBoard.errors[4309725].message }}
  • Profile picture of the author BloggingPro
    I've never personally experienced any performance issues when using postname as the perma structure. Do they mean that the site might load slow because of it? Either way I've never experienced anything of note to keep me from doing it.
    {{ DiscussionBoard.errors[4309763].message }}
  • Profile picture of the author ~kev~
    My permalinks are set to:

    /%year%-%monthnum%-%day%/%postname%/

    This makes the article look like

    websitename/2011-07-21/name-of-article/
    {{ DiscussionBoard.errors[4309850].message }}
    • Profile picture of the author Matt Barrington
      Originally Posted by ~kev~ View Post

      My permalinks are set to:

      /%year%-%monthnum%-%day%/%postname%/

      This makes the article look like

      websitename/2011-07-21/name-of-article/
      That's the same one I always use, and I've seen the best SEO results from. I don't think it makes a MASSIVE difference, but it's enough of a tweek that I use it every time.
      {{ DiscussionBoard.errors[4310263].message }}
  • Profile picture of the author Istvan Horvath
    With bigger sites there could be an issue if you have only postname - due to how WP retrieves the entries from the database.

    (If you want to get technical about it - see this post written by one of the WP Support mods and contributors:
    Category in Permalinks Considered Harmful » Otto on WordPress)

    Any numerical item, e.g. ID+postname would work better - according to the WP people...
    Signature

    {{ DiscussionBoard.errors[4309952].message }}
    • Profile picture of the author ~kev~
      Originally Posted by Istvan Horvath View Post

      With bigger sites there could be an issue if you have only postname - due to how WP retrieves the entries from the database.
      When I first opened my wordpress blog I use using only postname. In a matter of months I was starting to reuse the same title over and over.

      It should be just common sense that you need "some" kind of variable in the post name so that people do not repeat the "exact" same name over and over.

      Once the blog is 2 or 3 years old, its going to be easy to start repeating article names. People need some kind of variable that never repeats so the same "exact" article title is never repeated.
      {{ DiscussionBoard.errors[4309972].message }}
      • Profile picture of the author John Hoff
        Originally Posted by ~kev~ View Post

        When I first opened my wordpress blog I use using only postname. In a matter of months I was starting to reuse the same title over and over.

        It should be just common sense that you need "some" kind of variable in the post name so that people do not repeat the "exact" same name over and over.

        Once the blog is 2 or 3 years old, its going to be easy to start repeating article names. People need some kind of variable that never repeats so the same "exact" article title is never repeated.
        Why would you repeat your article's title? I can't imagine what purpose that would be unless you are repeating yourself. It shouldn't matter how many posts you have... unless I'm missing something.

        Listen, the best permalink structure out there is /postname/. Dates and categories just screw up your SEO because you don't have control over those, those postname you do through slugs. If I write a review article for the Oral B Triumph Toothbrush and it's tucked under a category of "Dental Hygiene", I don't want Dental Hygiene to show up in my URL, I only want "Oral B Triumph Toothbrush" (with maybe the word 'review' at the end of it).

        Besides, all the discussion is over when the top SEO guy (Matt Cutts) for Google tells you, "Use WordPress and use the /%postname%/ permalink structure".

        (I tried to add the link but I don't have enough posts in the forum to do that. To see the video, just Google blogtrainingclassroom matt cutts)

        Watch the video there. The talk about permalink structure is at 19:20 in the video.
        {{ DiscussionBoard.errors[4323848].message }}
        • Profile picture of the author mojojuju
          Originally Posted by John Hoff View Post

          Why would you repeat your article's title? I can't imagine what purpose that would be unless you are repeating yourself.
          It should be easy to come up with some scenarios where post titles might be repeated.

          For instance, consider a baseball blog which might have published a post titled Giants Win! in response to the San Francisco Giants winning the 2010 World Series.

          Now consider if the Giants win the World Series again in 2011 and the baseball blogger was to make another post appropriately titled Giants Win!

          Sure, in a sense, the blogger has repeated himself, but so have the San Francisco Giants.
          Signature

          :)

          {{ DiscussionBoard.errors[4323932].message }}
          • Profile picture of the author BarryWheeler
            Originally Posted by mojojuju View Post

            It should be easy to come up with some scenarios where post titles might be repeated.

            For instance, consider a baseball blog which might have published a post titled Giants Win! in response to the San Francisco Giants winning the 2010 World Series.

            Now consider if the Giants win the World Series again in 2011 and the baseball blogger was to make another post appropriately titled Giants Win!

            Sure, in a sense, the blogger has repeated himself, but so have the San Francisco Giants.
            Well, that sports blog is not going to have to worry about that for another 60 or 70 years.
            {{ DiscussionBoard.errors[4323982].message }}
          • Profile picture of the author John Hoff
            Originally Posted by mojojuju View Post

            It should be easy to come up with some scenarios where post titles might be repeated.

            For instance, consider a baseball blog which might have published a post titled Giants Win! in response to the San Francisco Giants winning the 2010 World Series.

            Now consider if the Giants win the World Series again in 2011 and the baseball blogger was to make another post appropriately titled Giants Win!

            Sure, in a sense, the blogger has repeated himself, but so have the San Francisco Giants.
            I see what you're saying but if that's all the blogger can come up with as far as a title goes then they really aren't thinking A) SEO and B) what makes a good title. And you and me both know that titles are one of the most important factors on your blog, not only for Google, but for humans.

            Giants Win! has very little meaning except for those few days during and after the big game. If the blogger blogs for 5 years they could have 500 articles all titled, Giants Win!

            That would just be silly.

            A better title would be, "Giants Win the 2011 World Series!".

            Now when someone searches through the archives it's clear what an article is about to both:

            - Humans
            - Google
            {{ DiscussionBoard.errors[4324044].message }}
            • Profile picture of the author mojojuju
              Originally Posted by John Hoff View Post

              I see what you're saying but if that's all the blogger can come up with as far as a title goes then they really aren't thinking A) SEO and B) what makes a good title. And you and me both know that titles are one of the most important factors on your blog, not only for Google, but for humans.
              I agree John, but I believe that's beyond the scope of this thread.

              The Giants Win title example was intended solely to demonstrate a possible technical issue pertaining to Wordpress blogs, and it was not intended to serve as an example of best practices regarding choosing post titles.

              While I agree there may be benefits to choosing post titles which are unique, it's nice to know that software like Wordpress has ways to handle any URL generation problem that may arise in the event that there exist posts with duplicate titles.
              Signature

              :)

              {{ DiscussionBoard.errors[4324189].message }}
  • Profile picture of the author rainman
    Originally Posted by Michael Colson View Post

    What structure is best for WordPress permalinks?
    I'll be honest. I think it's dead simple and that you basically have two options. The URL should end with the post name and could possibly be prefixed with the category. No other options really make sense.

    This means you'd end up with a permalink structure as follows:

    /%postname%/

    or, with the category:

    /%category%/%postname%/

    WordPress advises against this suggesting you NOT start your permalinks with category,tag, author, or postname fields.

    The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text "page slug" as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties).

    This information is now out of date and WordPress has rectified the performance issues however have not yet updated their advice in the codex.

    If your domain name is short and your category names are short and descriptive, there can be a pretty big benefit in having the category in the URL. You should take care though; if your slug (the part of the URL that identifies the post) is long and you have the category in the URL as well, that might potentially lead to a very long URL which is harder to share and won't benefit you as much in Google.

    If you decide to use the category in the permalink, make sure to pick short and descriptive slugs for your categories, and to preferably pick only one category for each post.
    Signature
    {{ DiscussionBoard.errors[4310201].message }}
    • Profile picture of the author ~kev~
      Originally Posted by rainman View Post

      I'll be honest. I think it's dead simple and that you basically have two options. The URL should end with the post name and could possibly be prefixed with the category. No other options really make sense.
      You must not have a very large website?

      When you start posting lots (in the hundreds or even thousands) of articles, your going to start repeating the article titles using just postname.

      You need some kind of non-repeating numerical variable in the article title. The best way to do that is with the date.
      {{ DiscussionBoard.errors[4310217].message }}
      • Profile picture of the author mojojuju
        Originally Posted by ~kev~ View Post

        You need some kind of non-repeating numerical variable in the article title. The best way to do that is with the date.
        No need to worry because Wordpress will automatically append a unique number to the end of the url. Somebody has already thought about that.

        So if you make a post titled "I like stuff", the url may become

        HTML Code:
        http://www.example.com/i-like-stuff/
        And if down the road, you make another post called "I like stuff", wordpress will simply create a different URL than the original "I like stuff" post like this for example:

        HTML Code:
        http://www.example.com/i-like-stuff-2/
        On a related note, since others mentioned performance issues with using just the post title in the URL, I don't worry about performance because I cache everything to static files and the URLs don't have to be generated on every hit.
        Signature

        :)

        {{ DiscussionBoard.errors[4310308].message }}
        • Profile picture of the author John Hocking
          I recommend using the format
          /%category%/%postname%/

          You can organize your site my keyword/category and that will help section your site into themes and get your keyword into the url.

          The main problem with useing /%postname%/ is that it makes it hard to create your own directories outsite wordpress. If you do, you will have to create refereneces in the .htaccess files so that WP does not try to look them up in the database.
          {{ DiscussionBoard.errors[4310382].message }}
          • Profile picture of the author mojojuju
            Originally Posted by John Hocking View Post

            The main problem with useing /%postname%/ is that it makes it hard to create your own directories outsite wordpress.
            Perhaps, but it doesn't make it too hard. The likely hood of there being a naming conflict between a directory and a postname seems pretty low if my assumptions are correct in that people mainly create post names consisting of multiple words and directories of single words.

            If that is true, it seems that category names or tags, normally being less verbose, would have the greater likelihood of ever conflicting with a directory name.

            If colliding post names and directory names is anticipated to be a big problem. A possible way to avoid that could be to just create all needed directories under a special directory named something like /d/ or something that is unlikely to be used as a post name.

            That's just one possible workaround to what may not even be a legitimate concern in some cases.
            Signature

            :)

            {{ DiscussionBoard.errors[4310509].message }}
  • Profile picture of the author Michael Colson
    The problem is not so much naming conflicts as it is lookup times and database query times. Finding an ID in a database is dead simple compared to finding a post name.

    Lifehacker uses /id/postname
    Mashable uses /y/m/d/postname
    TechCrunch uses /y/m/d/postname
    Engadget uses /y/m/d/postname
    Daily Beast uses /y/m/d/postname
    BoingBoing uses /y/m/d/postname

    I'm seeing a pattern.
    {{ DiscussionBoard.errors[4310827].message }}
    • Profile picture of the author mojojuju
      Originally Posted by Michael Colson View Post

      The problem is not so much naming conflicts as it is lookup times and database query times. Finding an ID in a database is dead simple compared to finding a post name.

      Lifehacker uses /id/postname
      Mashable uses /y/m/d/postname
      TechCrunch uses /y/m/d/postname
      Engadget uses /y/m/d/postname
      Daily Beast uses /y/m/d/postname
      BoingBoing uses /y/m/d/postname

      I'm seeing a pattern.
      Well Ok...

      dailyblogtips.com uses /postname/
      copyblogger.com uses /postname/
      johnchow.com uses /postname/

      But the mentioning of any of those sites or the ones you mentioned isn't really a compelling reason to switch to a particular permalink structure, in my opinion.

      There are some performance implications in using strictly /postname/ rather than including path segments related to dates or post_id's, but the performance difference is negligible as I have found.

      I also feel that going with dates in urls can likely result in less clickthroughs from search engine users because dates in urls can indicate when content is old.

      For instance, consider a person who is interested in buying an iPad. He may presumably want the newer iPad 2 which he might know was released in March of this year, 2011.

      Now if he goes and searches Google for "ipad review", he may get a result set as shown below.



      I don't know about you, but if I want recent information about the iPad 2, I'm not clicking on any of those links from 2010, which predate the iPad 2 by about a year. I would instead click a link that doesn't show that it's older than the device I want to read reviews about, or I would refine my search to say "ipad 2 review".

      Either way, I'm not clicking on those old links.

      A number, such as the post_id can be included in the URL, but that gets ugly and distracting. I think urls without the numbers are more readable, and more clickable. Besides, the performance differences in not including numbers in urls are negligible.

      I ended up doing a little performance testing of my own to see what difference there was, if any, in using /%postname%/ instead of /%year%/%monthnum%/%day%/%postname%/
      as a permalink structure. I remember reading that the Wordpress developers made some performance changes that make it so it's not all that bad to use just /%postname%/ as a URL scheme. Also, there's an index on the post_name field of the wp_posts table in recent versions of Wordpress, so that helps.

      Heck, even Andrew Nacin, a core developer of Wordpress, recently pointed out to a blogger named Chris Coyier that using /%postname%/ is not that bad...



      And it's not that bad. I think I mentioned that I did some testing on this. Basically, I took a Wordpress install that I have on my server, and I tested two types of permalinks, using apachebench - the Apache server benchmarking tool.

      For those that don't know, apachebench simply loads a URL as many times you tell it to with as many concurrent connections as you tell it to. For this experiment, I simply had ab load the homepage of a blog 1000 times with 5 connections simultaneously. The blog is running the most recent version of Wordpress and has 13,602 posts.

      Although my tests aren't exhaustive, I think you guys will see that the difference between using /%postname%/ for permalinks and something like /%year%/%monthnum%/%day%/%postname%/ is negligible.

      Here's a table of my results of using ab against two different permalink structures. I hope it's easy to understand.



      I think that the performance penalty that comes with switching from a url scheme with numbers to one with just the post name is minuscule. When you cache your posts to static files, the performance difference is even closer to zero. Also, I have a hunch that using shorter and "less numeric" urls may also be better for SEO in some instances and may even result in better CTR from search engine users.
      Signature

      :)

      {{ DiscussionBoard.errors[4313335].message }}
  • Profile picture of the author Michael Colson
    Thank you for the great reply, mojojuju, especially the link to the wpmods article. I switched mine to /%postname%/. I have one more question though: why is there a trailing forward slash?
    {{ DiscussionBoard.errors[4323560].message }}
    • Profile picture of the author mojojuju
      Originally Posted by Michael Colson View Post

      Thank you for the great reply, mojojuju, especially the link to the wpmods article
      You're welcome. The wpmods article is a good one. Here's another blog post that talks about the /%postname%/ permalihk structure.



      Originally Posted by Michael Colson View Post

      I switched mine to /%postname%/. I have one more question though: why is there a trailing forward slash?
      I use the trailing forward slash for no reason other than that I like the way it looks.
      Signature

      :)

      {{ DiscussionBoard.errors[4323740].message }}
      • Profile picture of the author Michael Colson
        Originally Posted by mojojuju View Post

        You're welcome. The wpmods article is a good one. Here's another blog post that talks about the /%postname%/ permalihk structure.

        I use the trailing forward slash for no reason other than that I like the way it looks.
        Thank you again! On that link they included a RedirectMatch to go from /y/m/d/postname to postname, and I was able to modify it to change my old link (id-postname) to postname using 301 redirects instead of leaving them at 404s.
        {{ DiscussionBoard.errors[4324108].message }}
  • Profile picture of the author Osawa
    My sites always set /%postname%/ better than using year month date
    {{ DiscussionBoard.errors[4325733].message }}
  • Profile picture of the author degreexyz
    Loads of useful comments and information. I have to make a decision about this today, and I thinks it's clear. I'm going with /%postname% - NB, no trailing forward slash!
    {{ DiscussionBoard.errors[4345817].message }}

Trending Topics