Recent commit to 3.3 eliminates performance issues with postname permalink structure

36 Comments

If you’ve ever used the /%postname%/ permalink structure on your WordPress site (and haven’t we all at some point) then this bit of news will interest you. A handful of WordPress core contributors have completed a patch that greatly improves the speed and scalability of WordPress’ verbose rewrite rules.

Andy Skelton, Otto, Mark Jaquith, and Jon Cave worked on the ticket, which was committed just last week for the 3.3 release cycle. Improving these verbose rewrite rules was one of the times on the checklist for 3.3, so things seem to be on track for a November release.

In an interesting (and telling) turn of events, a changeset not long after the previously mentioned patch added /%postname%/ to the list of options on the Permalink Settings screen. Not only is that permalink structure not recommended against, it’s now a recommended option:

Have you used just the /%postname%/ permalink structure on any of your sites in the past? Will you start using it more now that the concerns around its performance have been assuaged?

36 thoughts on “Recent commit to 3.3 eliminates performance issues with postname permalink structure

  1. I asked Mark Jaquith about this on twitter, and according to him, this patch fixes following permalink structures as well:

    /%category%/%postname%/ << The one that we use on WPBeginner
    /prefix/%postname%/

    • It changes the way permalinks work for any structure that caused the use_verbose_page_rules flag to be set.

      Essentially, the use_verbose_page_rules flag previously caused the permalinks to contain “verbose” rules for the pages, for any ambiguous structure. This is no longer the case. Instead, these cases cause a slight reordering of the rules, and the addition of a single extra database query, to determine whether a given URL is a valid Page or not. This change allows us to use that query to determine the difference between a legitimate Page and a single Post by using the database to figure that out instead of only having the URL and the rules to work with.

      Thus, the performance problem is eliminated. It is possible that somebody with a rather extreme level of nested hierarchical Pages could run into a performance issue, but this would be dependent upon the number of Pages and how deep they were, with depth being the key factor. I doubt you’d start noticing anything until you reached a depth of several hundred nested Pages, by which point your URL would already be rather long, and pretty useless.

  2. I’ve been using that structure all along and thrilled with the news that the penalty is being removed. Now, if they could just do something about that standard text editor. Would be nice to have it pull in the site CSS by default, encouraging theme designers to make the necessary code available by default too.

  3. Pingback: WordPress Permalink Structure | AppThemes Docs

  4. Yes, used /%postname%/ on small sites, would really like to use /%postname%/ knowing there won’t be performance issues but on the other hand having /%postname%/ without the post-id prevents being considered for Google News.

    So I’d use something like /%post_id%-%postname% or /%postname%-%post_id%.

  5. Very nice! I usually use the default month permalink, and don’t much care really what my permalink looks like on personal sites. But on a couple of projects (like a wine rating site I’m working on) I really would prefer just cat/post name, or on another just postname. Good to know that if I manage to get these sites to grow, I won’t have the issues to worry about.

  6. Not true about Google News insisting on a number in the URL – they dropped that requirement a while ago. My site uses /%year%/%postname% and is in Google News just fine.

    • @Caspar: Interesting point about Google News. Would anyone be able to confirm if just /%postname%/ would work with Google News?

      Excited about the forthcoming patch since most sites I build are small and just use /%postname%/.

      • The way I understand it is a requirement of being considered by Google News is your URLs must have 3 digits in them. Does anyone have an example of a site that is in Google News and uses just /%postname%/ ?

  7. Great news indeed and thanks for the additional explanation by @Otto!

    I’m wondering, for use with WPML the only permalink structure that has worked until now is the default “Day and name”. Do you think that with this issue being eliminated, we can now also start using postname with WPML?

  8. This is huge news. As WordPress continues to become a more established CMS platform, being able to use more natural looking permalinks without running into potential performance problems is better for everyone. I totally appreciate the WordPress devs tackling this issue for the next release. Thanks guys!

  9. Thanks for the heads up. I have several sites using the category/post as URL rule, all of them are still small (below 100 posts and pages combined), but it’s good to know that the performance issue is being dealt with. Speed is very important these days… people just won’t wait for a page to load. And some of us used to be just fine with a 14.4kbps dial up connection. How times have changed :)

  10. This is great. I just downloaded the files from the patch and installed them on WordPress 3.2 and I could see the difference right away. The pages load faster but not quite as fast as if you use the default ?p=123. Still though, it works faster which is great.

  11. Pingback: WordPress Melbourne September 2011 Meetup Wrap-Up | WordPress Melbourne User Group

  12. I take it then that if a site has a performace issue (currently) that when the fix comes it will re-rewrite the rules to remove the performace problem? (Did that make sense).

    Now if we could just have the ability to create a page with a custom url (when it is created) that would allow us to add something like ” .htm ” or ” .html ” to the end of the url witthout having WordPress change the ” .html ” to a ” -html ” that would be even better! This would help with being able to convert static html page sites to WordPress.

  13. I only found out about this penalty a short time ago, and was pleased to hear it was being addressed in the upcoming 3.3 release of WordPress. Up until recently I didn’t even need this functionality, but a couple of new clients wanted to keep their content “evergreen” and getting around this limitaiton was going to be a problem… not anymore!

  14. what a relief. I discussed with few SEO consultants and everyone suggested to start with %category% but with qualification. I am in process of changing permalink and can safely starts with %category% that will best suit to my readers to select my link – thanks

  15. What a relief. I heard about this issue quite some time ago and have been holding my ground till a change would be implemented and it looks like today we got 3.3.!

  16. Pingback: How to change the WordPress permalink structure to postname – OptimWise

  17. Hey Ryan,

    What I want to know is how can I change my permalinks structure from category/postname to just postname without affecting my posts URLs (backlinks) and keeping the SEO Gods (big G) happy?

    Thanks in advance,
    Sergio

    • To remove the “category” slug, use Yoast SEO plugin.
      Then, to be safe, use a permanent redirect plugin to create a 301 (permanent) redirection table from the old URLs to the new ones.
      To make it fool-proof, use Smart 404 plugin, that will make sure your visitors never end up on a page that doesnt exist.
      This works for me.

Leave a Reply

Please note that WPCandy is a moderated community.

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>