WP Permalink Structure

by 23 replies
27
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?
#search engine optimization #permalink #structure
  • 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).
  • 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.
  • My permalinks are set to:

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

    This makes the article look like

    websitename/2011-07-21/name-of-article/
    • [1] reply
    • 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.
  • 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...
    • [1] reply
    • 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.
      • [1] reply
  • 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.
    • [1] reply
    • 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.
      • [1] reply
  • 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.
    • [1] reply
    • 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.
      • [ 2 ] Thanks
  • 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?
    • [1] reply
    • 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.
      • [ 1 ] Thanks
      • [1] reply
  • My sites always set /%postname%/ better than using year month date
  • 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 - NB, no trailing forward slash!

Next Topics on Trending Feed

  • 27

    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?