WordPress Permalink Controversy – SEO versus Performance
The choice of Permalink structure in WordPress has prompted a lot of discussion with the ‘experts’ falling into two camps; SEO experts and WordPress purists. Each group makes an logical assessment from their own perspective.
Before we get into the differing views, some background on permalinks.
What are Permalinks?
Permalinks are the permanent URLs of your individual blog posts and pages. They are what are used to link to your site and also they are what the Search Engines use to index your site. In WordPress you can replace the WordPress URL of your posts which looks something like www.example.com/?p=47 by a structure that can include the post name, category, tag, author, year, month, day, etc. This ‘pretty’ URL is more readable and also increases the likelihood of a person clicking on the link if the link contains some of the keyword or phrases that the person is looking for.
Why is it Important To Get The Right Permalink Structure At The Start
If you change your permalinks you will lose all your search engine ranking positions for your existing pages UNLESS you add Redirect statements in your .htaccess file that maps the old page URLs to the new page URLs. Therefore normally you never want to change your permalinks and hence it is important to get them right at the start when you set up the blog before you add any posts.
Why is there is a Performance Problem with WordPress Permalinks?
When you try access a page using the permalink, WordPress has to work out what post the permalink refers to. It does this using its rewrite rules to convert the permalink to a post id.
WordPress keeps its rules for converting pretty URLs into post ids in the option_value column of the row in the wp_options table where the option_name is rewrite_rules. This field gets pretty big: several tens of thousands of characters in size in fact, and it keeps growing according to the number of pages, number of attachments and the number of categories, tags, authors, etc on the blog. This means WordPress has a lot of rewrite rules to sort through every time you access a post or an attachment.
The algorithms that WordPress use are more efficient at sorting through numeric structures than text ones. WordPress documentation describes its text sorting algorithms as its ‘verbose’ rules and therefore recommends its users to employ permalink structures that start with %post_id% or %year%/%monthnum%/%day%.
In a nutshell, WordPress rewrites rules are generally inefficient but permalinks starting with numbers are a lot faster then permalinks starting with text.
Now back to the two different camps of thought.
WordPress Purists Follow WordPress Permalink Recommendation
The Purists toe the WordPress line. They don’t like inefficiency and want their site to respond as fast as possible. The purists like the SEO benefits of having the postname in the permalink but are not willing to sacrifice performance. Their chosen permalink structure is typically /%post_id%/%postname% or /%year%/%monthnum%/%postname%.
SEO Experts Want More Visitors And Ignore WordPress Permalink Recommendations
The SEO guys are pragmatists; they want more traffic and use meaningful urls have better click through rates. They don’t mind the poorer performance of the blog as in most cases it is hardly noticeable, especially if caching is enabled. They don’t believe it trying to solve performance problems until they happen.
A SEO slanted view produces a permalink structure such as /%postname%, /%postname%-%post_id%, or even /%category%/%postname% to maximize the number of keywords in the URL
Is Performance or SEO More Important?
This is an easy answer for me: SEO is more important.
My reasoning is as follows: SEO must be good and performance must NOT be bad.
I want to maximize the number of visitors to my site and a pretty URL helps with that. I can live with the trade off of a 5% slower blog with 5% more visitors.
Performance is unlikely to be an issue for me for five reasons
- I don’t have thousands of visitors accessing my blog at the same time (at least not right now)
- I don’t have thousands of pages on my blog (at least now yet)
- I host all post attachments such as images and videos on Amazon S3 to ensure the good performance under high traffic. As well as taking the heavier image traffic off my WordPress server, this keeps the rewrite rules simpler by not having attachments.
- I have installed the WP Super Cache plugin which means pages are returned from a cache rather than being fetched from the database every time. This probably gives a one hundred fold increase in the capacity of the blog to serve pages to visitors
- I host my blog on a Liquidweb VPS rather than a shared host account which delivers much more consistent performance
The last three measures mean that WordPress page content and media content is delivered fast and consistently so if one of my posts does get the Digg effect then the blog is still able to cope comfortably under the load.
Why it is useful to include the Post_Id in the Permalink Structure
Quoting from the WordPress Permalink Guide
If you want to list your site in Google News, one of the requirements is to have at least three digit identifier at the end of every url.
This is not quite accurate in two respects: firstly the three digits can appear anywhere in the URL; and secondly there is an alternative to having the 3 digits which is to use Google News Sitemaps
I do like to have the ability to submit the blog to Google News but don’t want to have the hassle of maintaining a news sitemap so I do use the post_id.
What Permalink Structure Is Best
The two permalink structures I recommend are:
- /%post_id%/%postname% ; and
- /%postname%-%post_id%
Is there really much of a difference regarding the ‘clickability’ of these URLs
- www.example.com/123/how-to-make-millions-of-dollars-overnight; and
- www.example.com/how-to-make-millions-of-dollars-overnight-123
- www.example.com/how-to-make-millions-of-dollars-overnight
I think probably not. The third is slightly better but the post_id is not particularly off-putting in the first two URLs.
My recommendations for permalinks are therefore as follows:-
If you have a blog with thousands of pages, or thousands of attachments hosted on your WordPress server, then go for the first option otherwise go for the second option
For big blogs use:
/%post_id%/%postname%
For small and medium blogs use:
/%postname%-%post_id%
As a final word there are some scenarios where I do consider the using the category in the permalink but only under specific conditions where the blog is small and there is a single category for each post and the category is static. Again the SEO benefit of having the keyword laden category named is traded off against the loss on performance.











{ 7 comments… read them below or add one }
New here… stumbled in from Pearson’s latest article.
I’ve said a lot about this in the past, but I like your recommendation here.
There are issues on the WordPress Trac concerning improving permalink handling. My hunch is sometime in 2010, somebody will simply put in the effort and revamp the lookups.
Now I need to figure out how to find you again.
Dave Doolin´s last blog ..Saturday Morning Surfing: Passion is NOT Enough – Your Landlord Doesn’t Give a Rat’s Patootie
Dave, Thanks for your feedback.
I hope your hunch is right about Wordpress addressing permalink performance later in 2010 once they have put the 3.0 release live on April 13th.
Hey Russell,
fyi, I found this post by googling “wordpress thousands of pages” (top of second page) so your SEO must be working
Great info, well presented and timely for me. Basically you have confirmed what I had just about decided based on considerable research. I’m in the process of setting up a new blog for which I expect to have several thousand Pages and the performance issue has been a concern. Looks like I will be going with the /%post_id%/%postname% structure. BTW, do you see any value in adding a final ‘/’?
Hi David,
I need to dig a bit deeper regarding your trailing slash question. There may be duplicate content issues with the extra slash.
Empirically it should not be required but I need to look further into this to understand the practicalities.
I will get back to you in a the next 7 days. In the meantime check out this article which considers the trailing slash question: best wordpress permalink structure
Russell
Hmm, interesting article. Thanks for the input.
You don’t need the trailing slash, but having one will prevent your server from working too hard – see this article here : http://www.alistapart.com/articles/slashforward/
Thanks for the great post. I’ve been on the fence regarding the use of the /%post_id%/%postname% verses just /%postname%. BTW, I found your post with “permalinks wordpress recommendation” in Google search.
Peace,
Roey.
Roey´s last blog ..Family Vacation Ideas In The Northeast