50 Days to a Better Blog–Day 8: Proper Permalinks

WordPress

This post is the eighth of an ongoing series entitled “50 Days to a Better WordPress Blog”.  During this time, Mitch will be providing small snippits of code, plugins, and things you can do to make your blog more attractive, attain new readers, and keep old ones coming back time and time again. You can see the entire series here.

Following suit on our last post (regarding SEO and SEM), I thought it would help to talk about a hotly contested area of the subject – permalinks.  If you’re looking at this in a feed reader, or from the main blog page, then click on the title to visit the site, and look up in the URL bar – that’s a permalink, or a “permanent link” to your post.  Since content lives in the database (and not files on your webserver), permalinks are just an easy way to call a specific post or page query (http://www.yourblog.com/about/ instead of http://www.yourblog.com/?page_id=3) as well as providing insight to what the page  contains (you can guess that it’s an ‘about’ page from the permalink ending [also known as a ‘page slug’]).

Setting Permalinks

Setting permalink structures is the easy part of all this.  Simply visit your WordPress blog’s options page and click on Settings > Permalinks.  There are a number of predetermined tags there that you can call on.  Typically the list runs down like this (taken from the WordPress Codex):

  • %year% – The year of the post, four digits, for example 2004
  • %monthnum% – Month of the year, for example 05
  • %day% – Day of the month, for example 28
  • %hour%– Hour of the day, for example 15
  • %minute%– Minute of the hour, for example 43
  • %second% – Second of the minute, for example 33
  • %post_id% – The unique ID # of the post, for example 423
  • %postname% – A sanitized version of the title of the post (post slug field on Edit Post/Page panel). Starting Permalinks with %postname% is strongly not recommended for performance reasons..
  • %category% – 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.
  • %tag% – A sanitized version of the tag name (tag slug field on New/Edit Tag panel). Starting Permalinks with %tag% is strongly not recommended for performance reasons.
  • %author% – A sanitized version of the author name. Starting Permalinks with %author% is strongly not recommended for performance reason

You’ll notice that a lot of the later tags have a disclaimer of sorts attached – it mentions that you shouldn’t use these tags at the start of a permalink for performance reasons.  You’ll also see a LOT of people (myself included) including either just POSTNAME or CATEGORY/POSTNAME in their permalink structures.  In all honesty, the performance issues related to starting with one of those tags are negligible at best, even more so if you’re properly caching your site, so for once I’m going to disagree and say that it’s OK to use those to start permalinks. Therefore, here are a few recommended permalink strucutres:

  1. /%year%/%category%/%postname%/
    ex. /2011/wordpress/this-is-a-post-name/
  2. /%category%/%postname%/
    ex. /wordpress/this-is-a-post-name/
  3. /%year%/%author%/%postname%/
    ex. /2011/mitch/this-is-a-post-name
  4. /%year%/%category%/%author%/%postname%/
    ex. /2011/mitch/wordpress/this-is-a-post-name/

Most people use categories more than tags, but if you find yourself using tags more often than categories then you can substitute /%tag%/ for /%category%/.

You can also include standard words in there, but don’t go crazy with spaces or semicolons; use dashes to represent spaces and leave out any weird punctuation marks.

Category/Tag Structure

Down below you’ll also notice that tags and categories have their own structures as well.  Most people like to keep them as is, but if you call your tags “keywords” or your categories “topics”, then you can change the URL redirection down below as well.