In the first part we have talk about how bad and dangerous could be configuring permalinks in WordPress blog. In this article we will show you solution for best configuring permalinks!
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. One good solution we recommend “/%year%/%monthnum%/%postname%”.
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.


