Update 1/4/2011: The problems described in this article regarding WordPress functionality breaking due to permalink structures have been fixed in version 3.0 and higher. Now the permalink structure suggested by the people mentioned in this article is the best solution for SEO optimized URL’s. However the WordPress Codex, the official WordPress documentation, still suggests that you should start your permalink structure with a number for performance reasons. In most WordPress sites, the performance hit caused using the permalink structure suggested by the SEO experts below would not be large enough to out-weigh the SEO benefits.
Let us start by giving a nice big thanks to experts in the SEO community. It’s likely because of them that there are literally thousands, possibly millions, of WordPress installations that setup with less than optimal settings. Many unsuspecting and uneducated users look to this group of experts for ideas and techniques to improve their search engine rankings and to gather more website traffic. Little do these users know that even some of the most popular people in this group of experts are handing out bad advice regarding how to setup WordPress systems.
Bad WordPress Permalinks Advice
Most of the SEO experts on the net recommend that users setup their WordPress permalinks in a very specific way. Every article on the net I have seen written by an SEO expert regarding WordPress permalinks suggests that users either use “/%postname%” or “/%category%/%postname%” for their permalink structure. This is a bad idea for many reasons, which I will cover below, yet the SEO experts continue to promote it.
In fact I was at SearchFest, a Portland SEO & search marketing conference, in March and I watched an SEO expert use this as his suggested permalinks structure to an entire room of people during a WordPress SEO session. Now I just feel bad for anyone who actually wrote down or took that advice. There are much better ways of setting up your permalink structures.
Why Are Those Permalinks Structures Bad?
Well to sum it up very simply it comes down to two things. Speed and Reliability. Thinking from the blog readers points of view these have to be the two of the three most important items that your blog can give them. The third of course being content, but that’s not what we are here to talk about today.
Let’s start off with reliability and how these permalink structures affect that. Both of these permalink structures have the first variable in the structure as a text based keyword. The variables I am talking about of course are %category% and %postname%. Unfortunately by using a text based variable you can cause WordPress to get confused when the system goes to process the request from your users. The reason for this is that there are just too many possible items it can match.
When we look at a example URL of “/blah-blah-blah/”, WordPress can run into problems when trying to match items to the request. Does it match a category, a page name or a post name? All of these text based variables use the same pattern matching so the system would have to run multiple database queries to figure out what the user is looking for. That’s not to mention the fact that the system also has to parse that request for attachments, tags, author pages and feeds which all use text based keywords as well.
Even then the system could get confused if you have a page/sub page combination that matches the slug of a category/post combination. Which one should the system load? These combinations of random keywords could easily cause WordPress to load the wrong page or post for a user which in turn makes your site less reliable in the user’s eyes.
So now compound all of the above with the speed issues. The most obvious of speed issues is that WordPress has to run all of those database queries that I mentioned above.Those are not lightweight and fast queries. They take time and delay the loading of the page that the user is requesting. How many times have you left a site because it loaded too slowly?
Another speed issue is for the WordPress author themselves. When using a permalinks structure with a text keyword as the first variable you end up causing WordPress to generate internal redirects to try and fix the issues mentioned above. These redirects are stored in the wp_options table in the database and are generated when authors add and edit posts or pages in the system.
The system is semi smart and generates internal redirects for all the pages that are loaded into the system. A simple page with a couple of attachments, whether they are displayed or not, can easily generate 11 internal redirects in the database. This is because the system needs the redirects for the page, it’s attachments, the trackback URLs and feeds that go with it. To make matters worse the system has to have a line for the redirect as it would show up in the request, the permalink for the item, and a line for how WordPress is to understand that request. So now we can double the number of lines in the database for that one post to 22 lines.
So by using the permalinks structure with the first variable being a text based keyword the system now generates these redirects upon saving a post/page and causes delays for the author. In fact there have been reports where users with 200 or so pages, with random attachments, in their WordPress installations actually causing server time outs during the generation of these redirects. This causes them not to be able to post to their WordPress installations at all.
Continuing with the speed problems, lets not give up on those internal redirects. Those internal redirects also affect the users of the website and their page loading speeds. With every page request the system has to load all of those extra redirects and process them. That’s 22 extra lines of code per request that has to be processed before the page will load for the end user. Imagine if you had a simple site with 10 pages, that’s an extra 220 lines of code. That is of course is on top of the other 125 lines of code for internal redirects that WordPress needs by default with no pages.
I took a look at one of my customers blogs who has 24 pages and compared that to his internal redirect list. His redirect list had a total of 773 lines of code that needed to be processed for every request to his blog. As you can see that 22 lines of code is a lower end figure when compared to his total number of pages. On our blog we have 22 pages and do not use one of the permalink structures above. Our blog only has 140 lines of redirect code that has to be loaded and none of those reference any of our pages individually like our customer’s redirects did.
Be advised that none of this touches on what kind of damage your doing to your server. Since WordPress is written in PHP and MySQL, all of the requests and code are processed on the server side rather then the user’s end of the connection. By adding excess lines of code for redirects and increasing your number of database queries, you are also increasing the amount of work your WordPress hosting server is having to do. That also isn’t a good thing.
So What is the Solution?
The solution is to use a permalink structure that does not start with a text based variable. By doing this you will drastically reduce your risk of the problems listed above. Here is a list of variables you can use that are not text based:
- %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
Now that doesn’t mean you can’t have text based variables in your permalink structures, you just need to make sure the first variable is not text based. On Weberz we use “/%year%/%monthnum%/%postname%” as our permalink structure.
Why Would The SEO Experts Recommend The Wrong Structure?
The reason SEO experts recommend the “/%postname%” or “/%category%/%postname%” structure is simple. It makes the URLs easy to remember and it introduces keywords into the URL string that should match the content of your post. Typically in SEO the shorter the URL the better as its easier for the users to remember. The reason some SEOs recommend adding %category% to it is because categories normally include common keywords in the name that match the contents of the posts in that category. Are these extra 2-3 keywords from %category% worth it? Not in my opinion.
A better question would be why aren’t SEO experts recommending the permalink structure of “/%year%/%monthnum%/%postname%”? A simple answer to that one would be because they think the URL might be too long or they are unaware of the issues I am writing about today. After all some of these problems were not introduced until WordPress 2.7 was released. Hopefully some of the SEO experts will read this article and change their recommendations to their customers.
Why Blame the SEO Experts For This?
SEO experts are the ones who always are trying to optimize their pages to get the best search rankings possible. They are likely the reason that these options even exist for the permalink structures. Always wanting to get a extra 2-3 keywords in the URL out of the %category% tag or wanting to shorten the URL to just “/%postname%”. It’s just insanity.
Of course there is always the fact that they are the only ones I see recommending this to people because of the optimization boost that it can give you. If it wasn’t for SEO, there would be no reason to use one of those permalink structures except to make things look pretty.
How Do I Know This is Real and Not Just Your Crazy Opinion?
That is a very good question. Unlike the SEO experts opinions, I happen to have the official WordPress documentation on my side. The WordPress Codex page for Permalinks specifically states the following:
“For performance reasons, it is not a good idea to start your permalink structure with the 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). So, it is best to start your permalink structure with a numeric field, such as the year or post ID.“
Really who is going to argue with the official documentation? Just in case you still think I might be making it up, here is a link to a discussion on the WordPress Testers mailing list thread that discusses these very issues.
Now as of the time of this writing there is a patch for part of the problem listed above. A user has provided the WordPress developers a patch via the WordPress Trac site to make the generation of internal redirects faster when authors save a post or a page. While I believe this is great, it still doesn’t solve the issue of those redirects needing to be there in the first place. Even if you generate the redirects faster, you still have the problem of having to process them with every request from a user. Seems like a band aid over a much bigger problem.
So Who Are These SEO Experts Giving The Bad Advice?
Honestly the list is too long to name everyone. There are a few key people in the community that I am going to point out anyway. Now don’t get me wrong, all of these people are extremely good at what they do and I have a huge amount of respect for them. It’s just on this particular issue, they got it wrong at some point in the past.
- Scott Hendison – Scott runs a internet marketing company called Search Commander and was the one who introduced me to WordPress. Scott also has a WordPress plugin called WordPress Core Tweaks that automatically cleans up your WordPress installation for you. Unfortunately Scott’s plugin sets your permalinks to “/%category%/%postname%” which we now know is less then optimal.
- Aaron Wall – Aaron is the founder of SEO Book – SEO Training Made Easy. SEO Book provides a number of good articles to readers about search engines and the SEO community as well as sells an ebook written by Aaron. Aaron mentioned in this comment under a blog Q&A session that he likes permalinks that are “/name-of-post” or “/2007/09/name-of-post”. At least one of them was a good format right?
- Joost de Valk – Joost runs Yoast.com a website dedicated to tweaking websites for better SEO. Joost is particularly popular among the SEO community for having great WordPress SEO advice and some of the best WordPress plugins available. In Joost’s WordPress SEO article under section 1.1 titled “Permalinks” he specifically states “I prefer to use either /post-name/ or /category/post-name/“.
- Michael Gray – Michael runs Graywolf’s SEO Blog a widely popular blog covering search engine optimization and search marketing news. In this thread Michael not only shares with users that he uses “/%category%/%postname%/” for a permalink structure, but also helps users solve some related permalink problems in the comments.
- Matt Cutts – Matt is head of the Google web spam team and runs a personal blog on mattcutts.com. Matt is not an SEO but he is a major figure in the SEO community. Matt recently posted the slideshow that he used at WorldCamp 2009 when discussing blogging and WordPress among other things. There was no video posted but on slide 25 Matt was obviously talking about URL structures and permalinks. Unfortunately the slide also shows users should use a permalink structure of “/%postname%/”.
- Jordan Kasteler – Jordan runs Search & Social and also has a Utah SEO Blog setup where he posts copies of his conference presentations. Jordan was the presenter at SearchFest 2009 that informed an entire room of users on how to setup their WordPress installations incorrectly. Here is a copy of his slides.. Slide 10 is obviously my favorite!
To add to the list above of people who handed out the wrong advice to users, below is a list of SEO experts that are using the wrong permalink structure on their own blogs. Since I couldn’t find anywhere that the people below had handed out advice on what to use, I didn’t want to mix them with the wrong doers above.
- Vanessa Fox – Vanessa runs Nine By Blue and previously worked for Google where she built Webmaster Tools. Unfortunately Vanessa setup a blog on Nine By Blue where she uses /%postname%/ as her permalinks structure. She even talks about changing the structure in this post.
- Adam Audette – Adam runs Audette Media a strategic internet marketing firm. Audette Media was kind enough to put up a blog where the primary poster is Adam himself, unfortunately they used /%postname% as well.
- Stephan Spencer – Stephan runs Net Concepts an SEO marketing and consulting firm. While I could find many places, including a WorldCamp 2009 presentation, where Stephan recommends users shorten their URL and create custom post slugs, I couldn’t find anywhere he actually recommended a permalink structure. With that in mind, the Net Concepts blog also seems to use /%postname% or a custom post slug for each entry which is also a text based variable.
- Danny Sullivan – Danny is the founder of Search Engine Land which is one of the largest sites on the internet for covering search engine and search marketing news. Danny’s personal blog located at daggle.com is also a WordPress blog. Unfortunately Danny setup his permalinks structure to be /%postname%-%postid% which is also not a good way of doing things.
By now you are probably asking if anyone did get this correct, the answer is Yes! I was able to find two SEO experts that actually have their blogs setup correctly and didn’t appear to give advice to anyone on how to setup their permalinks. These two great individuals are:
- Jeremy Schoemaker – Jeremy runs Shoemoney.com where he shares his experiences in online marketing. Jeremy uses a permalink structure of /%year%/%monthnum%/%day%/%postname%.
- Neil Patel – Neil runs QuickSprout where he explains and discusses ideas and techniques for online marketing and social media. Neil is also using the permalink structure of /%year%/%monthnum%/%day%/%postname%. As a side note, Niel also provided the best SEO presentation I have ever seen at SearchFest 2009… If only there was a video of it.
Hopefully this article will enlighten WordPress users and the SEO community to find a new permalink structure to use and promote. While it’s certainly obvious from the points above that there are better permalink structures available, I have no doubt that some users will continue to use bad ones. From your point of view, is using one of these bad permalink structures worth it? Is the extra processing and potential load time issues worth getting a extra few keywords into the URL? Share your comments below and let us know!