During the 6.2 Release Cycle, members of the WordPress Performance Team performed a performance analysis in order to identify the biggest opportunities to target for future performance enhancements. To do so, the team first created a methodology that could be used to perform a repeatable process by which results could be tested and confirmed. The full methodology and analysis can be found in this document.
To start, the team identified a number of key use cases that would be tested. These were meant to cover the primary out of the box functionality of a simple, default WordPress site, which included testing both a classic theme (Twenty Twenty-One) and a block theme (Twenty Twenty-Three) both configured with the same content from the Theme Unit Test data. 5 specific scenarios were tested for both themes:
Each profiling test was done on a wp-env docker environment running PHP 7.4 (the recommended version for WP when the analysis was conducted) with XHProf installed for profiling. Other use cases and configurations were considered but not included in this initial analysis, including testing with a persistent object cache active, a multisite setup, and additional supported PHP versions.
Below are the biggest opportunities identified for potential performance improvements, based on the profiling data collected against WordPress 6.2. An overview of the raw data for these observations is in the full results spreadsheet. When possible, relevant existing tickets for each improvement area are included for reference. These are not meant to be an exhaustive list of everything that will be addressed and additional tickets should be created as needed.
In the classic theme tested, the most expensive process is related to locating and rendering template parts. This starts with get_template_part(), includes the process of locating the template part files with locate_template(), and rendering the content for each template part. This whole process accounted for approximately 30–60% of the entire server response in the test results, with much of that time spent handling filesystem checks (e.g., file_exists() is responsible for 4–9% of all time measured and can likely be optimized with a cache), rendering widget blocks, etc. Given many of these filesystem checks aren’t likely to produce different outcomes often between requests, there are likely opportunities to find substantial improvements here.
Related tickets:
Related to template loading, loading and rendering block widgets (i.e. profiling WP_Widget::display_callback) took ~8–24% of the response time. This may be partially due to the inclusion of widgets in the theme test data and may not be representative of all themes. Even so, we have identified that much of this code runs even when a theme is not utilizing widgets, making it a good candidate for further exploration. It’s possible that some widgets have a larger impact than others. For example, the core categories block used in the category list widget was responsible for 5–10% of the response time in our tests.
Related tickets:
In all test scenarios, register_block_type_from_metadata() is called 91 times and takes from 3–24% of total response time across use cases, with a larger impact on block themes than classic themes. It is heaviest on the home page, and always worse in the first request compared with subsequent ones. Again, much of this time is due to file operations that could be optimized. We could also consider techniques like lazy loading block registration based on whether blocks are in use on a page, or caching registered blocks to avoid duplicate file read operations for blocks that are unlikely to change. For block themes, block registration accounts for 15–25% of the total response time, with register_block_style_handle() specifically accounting for most of that time (184 calls, 13–21% of inclusive wall time, or iwt).
Related tickets:
In both theme types, the load_textdomain() function was called 2 times when language packs are in use (once for core, and once for the theme), and is responsible for 9–26% of the total response time (most of which is the MO::import_from_file method). This took up a higher percentage of the execution time in the classic theme tests (17–26%) than the block theme tests (9–16%), which may point to opportunities for improvement in classic themes.
Related tickets:
For block themes, resolving block templates from the file system takes a large amount of time. This is likely due to the need for both database and file system reads during this process. Example function paths:
Related tickets:
Term field sanitization is being called ~3000-5000 times during a page load in our classic theme tests—adding 1–6% to the total response time alone. A recent change has already been identified that contributed to this problem, and a fix has been committed. A deeper look into ways of reducing unnecessary calls to this function could result in additional improvements. Interestingly, block themes don’t exhibit the same problem with sanitize_term_field, as with classic themes, so it would be helpful to understand why to see if the same improvements could be applied to classic themes.
Related tickets:
Other notable functions that are taking up a lot of time in block themes related to parsing and using data from theme.json and block registry include:
Related tickets:
Of all the opportunities identified during this analysis, the ones that seem likely to produce the largest impact are the following:
These efforts will likely require additional research and architectural design before engineering begins. All other items identified could be worked on directly through individual Trac tickets as capacity allows.
Thank you to @annezazu, @desrosj, @flixos90, @mukesh27, @oandregal, @spacedmonkey, and @swissspidy for reviewing and helping with this post.
WordCamp Asia 2026 brought the global WordPress community to Mumbai, India, from April 9–11, gathering…
WordCamp Asia 2026 will be available to watch live across three days of streaming, making…
April 9-11, 2026 | Jio World Convention Centre, Mumbai, India WordCamp Asia 2026 brings the…
The second Release Candidate (“RC2”) for WordPress 7.0 is ready for download and testing! This…
When WP Engine acquired WPackagist on March 12, the WordPress developer community faced a familiar…
The first Release Candidate (“RC1”) for WordPress 7.0 is ready for download and testing! This…