WordPress 6.0 to Introduce Performance Improvements for Custom Pages

WordPress core committer Jonny Harris merged a patch into WordPress core for a 12-year-old ticket that he says has the potential to bring “a massive effect on performance for custom pages.” The change, which will be included in the upcoming 6.0 release, stops unnecessary queries when developers are using the do_parse_request filter, thanks to a refreshed patch from contributor Paul Bearne.

Harris summarized the problem and how the change improves performance in the commit message:

Developers of plugins and themes can use the do_parse_request filter to hot-wire requests and hook in early to render custom pages. However, even through these request may not need post queries and 404 lookups to be run, they run anyway. This can results in unnecessary SQL queries running on these requests. By adding a return value to the parse_request method of the WP class, these queries can now be skipped.

WordPress core contributor Konstantin Kovshenin detailed the need for this change in a Twitter thread he published in 2021, when soliciting help for the ticket:

Harris performed a quick review of plugins that use the filter and said he does not anticipate breakages. The search found 133 plugins using the filter. Some of the most popular ones include Google’s Site Kit plugin (1M+ installs), The Events Calendar (800K installs), and AMP (500K installs). Harris suggested the change requires a dev note, as it may have unanticipated side effects. The dev note is likely to be published closer to the time of release. WordPress 6.0 is currently scheduled for release on May 24, 2022.


6 responses to “WordPress 6.0 to Introduce Performance Improvements for Custom Pages”

  1. I’ll take anything that boosts performance on a WP website, especially now with some plugins being almost necessary to have.

  2. The Event Calendar doesn’t use this feature. They just mentioned it in their code comment.

  3. 20 minutes after upgrading to WP V6.0 my Google Lighthouse speed score dropped from 84 to 22 – I’ll give it a few more hours before I roll things back


Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: