[wp-hackers] Performance improvement -- '/%postname%/%post_id%/' over '/%postname%/'?

Otto otto at ottodestruct.com
Sat Jan 11 19:48:13 UTC 2014

On Sat, Jan 11, 2014 at 10:44 AM, Aahan Krish <krish+wphackers at aahan.me> wrote:
> Considering that many posts are made each day (upwards 50), which of these
> two permalink structures would suit us best?
> /%postname%/, e.g. domain.com/sample-post/
> /%postname%/%post_id%/, e.g. domain.com/sample-post/123/
> Will the '/%postname%/%post_id%/' permalink structure help as the database
> size grows (i.e. the no. of posts)? or can we simply stick with
> '/%postname%/' no matter what?

They will be basically identical in terms of performance, for any
WordPress version. Using either form will trigger the
"verbose_page_rules" flag.

- This will cause WP versions pre-3.3 to generate individual Page
rules in the rewrite rules list. This can be a problem if you have
lots of Pages.
- This will cause WP versions post-3.3 to generate 1 extra SQL query
to determine if the URL matches an existing Page in the database.

In either case, the impact of the two different rules is identical. No
need to tack a post ID on there.


More information about the wp-hackers mailing list