Layout Image

WordPress Pretty Permalink Performance Patch Pending

Alright, I couldn’t resist the alliteration, but this is exciting!

For years, the WordPress team has been advising us not to use our post name in the Permalinks. That’s about to change with WordPress 3.3 soon to be rolled into Gold.

If you do not know what Permalinks are, they are the “permanent link” or URL of each of your pages or posts. If you go to the Settings…Permalinks section of your WordPress dashboard you will see the various options available.

By default, WordPress configures your permalink structure with the simple post number, so Post number 5 on your site would have the following URL:

http://yourwebsite.com/?p=5

Not very attractive is it? A more friendly option would be to use the post name, which would result in the URL

http://yourwebsite.com/the-name-of-your-post/

The WordPress Codex has traditionally given us these words of warning on not using the post name as your permalink (emphasis added):

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.)

Because of this, many bloggers have resorted to using the “Day and Name” or “Month and Name” options, which datestamp your post in the URL.  For publishers who desire to have “evergreen” content, that is, content that transcends time because there will be no date associated with the post in the URL, this has historically been a problem.

In the new 3.3 release of WordPress, you can see “Post name” is now an option in the Permalinks Settings screen.

A huge thanks is due to Andy Skelton, Otto, Mark Jaquith, and Jon Cave, who worked on solving this nagging issue for the next release, due out by the end of November, 2011

Tell the Dojo:

Have you used /%postname%/ for any of your websites before? Have you experienced any problems? Will you start using it from now that performance is no longer causing performance hits? How many posts did your site have that did experience problems using just the post name?

Leave a Reply