WordPress Tips – How to Structure your Permalinks

by Elaine on September 7, 2011

I just finished reading a really good article about the Wordpress Permalinks structure written by Chris Coyier over at Digging into WordPress.  His article basically steps through his research and analysis of possible reasons why his website, sitting on a VIP server, crashed and when it was restored still had poor performance.   This article really hit home because I am currently using the %postname% Permalinks structure and just dreading to switch over to his recommendation.

Permalinks Problem – Do not use just %postname% as your Permalinks

I love my current Permalinks structure %postname%,  it’s easy to read, SEO friendly and I love reading my links as cmsmind.com/Wordpress-permalinks.  The catch here is that WordPress Pages also start with text which is identified by its “Page slug”.  These page links cannot be altered.  The dilemma is how can WordPress distinguish if your article is a post or a page.   If you have tons of pages and posts, a search or a simple save can overload the database while it searches and even crash your website.

Here is a quote from The Codex straight from WordPress.org

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 for the first structure tag to be a numeric one, such as /%year%/%postname%/. (Some people recommend /%post_id%/%postname%/ which works for performance reasons but others recommend against it because it is unfriendly to users in the many contexts in which users interact with URLs.)

Permalinks Solution

The solution would be to simply change your permalinks in your Settings to a /%post_id%/%postname%/ or /%year%/%postname%/ both which will clearly distinguish your posts from pages.  If you have a new website this would not be a problem, but if your WordPress website has many posts this poses a new problem – What about all the 100’s of posts I’ve created, how will it affect my SEO?

Chris and many others have switched their permalink structure to /%year%/%monthnum%/%postname%/ and have experienced dramatic improvements to website performance.  WordPress will automatically detect changes to post links and handle the 301 redirects from the old format to the new format. 301 redirects are what Google needs to know about your new format and update itself and retain your ranks.   So I can switch over my permalink structure without taking any SEO, google rank or traffic degradation.   I will trust them since hey, they are industry experts.

Taking Action

I read further down Chris’s article and read some refreshing information.  The %postname% permalink post structure will be fixed in WordPress 3.3.   This information is straight from Andrew Nacin, core developer of WordPress.

I just want to confirm that WordPress 3.3 (due in November) will indeed remove all permalink performance issues related to %postname%, %category%, and the like. It’s done and currently in trunk. So look for that in the coming months.

Conclusion

Even though WordPress 3.3 will remove permalink performance issues surrounding %postname%, I will definitely have to change my permalinks structure soon to start with a numerical value instead of a text.   I will test it out and update this post once it’s complete.

Thanks,

Elaine

 Wordpress Tips   How to Structure your Permalinks

Elaine

Elaine is the founder of CmsMind, an online blog providing Joomla and WordPress tutorials. Elaine lives in Toronto and when she is not online, she is either Marathon and Triathlon training or travelling and racing somewhere in the world. Find her also at: Save Money, Premium Themes and Templates, and at Webhosting Tips.

More Posts - Website

{ 5 comments… read them below or add one }

vignesh senthil November 4, 2011 at 2:39 pm

thanks eliane for this very useful info

Reply

vignesh senthil November 9, 2011 at 12:39 pm

is it OK to use /%year%/%monthnum%/%postname%/ as per chris above. pls advise

Reply

Elaine November 10, 2011 at 12:49 pm

Hi Vignesh,
Wordpress 3.3 is in beta now. So the need to change your permalink structure might not be necessary. But, Yes. It’s OK to use that permalink structure above. Chris is the expert. If you are starting off with Wordpress it’s great to get the structure right the first time without having to change it later.
THanks for your visit,
Elaine

Reply

Arslan Qamar March 14, 2012 at 11:48 am

can I use same example on joomla???

Reply

Elaine March 14, 2012 at 10:55 pm

Hi Arslan,
Sorry, permalinks is only for Wordpress. Although you can go to under Global Configuration and set your links to be SEF – search engine friendly.
Thanks for your visit,
elaine

Reply

Leave a Comment

Captcha Captcha Reload

Older Post:

Newer Post: