The latest update to WordPress, version 6.4, includes changes to how scripts are loaded on the front end that will improve page load times and performance for many sites.
Script loading strategies are now incorporated into the core and bundled themes of WordPress, improving the performance of loading scripts with defer and async attributes.
These attributes instruct the browser to load scripts in the background (async) or after the rest of the page has loaded (defer), which can significantly speed up the time it takes for a page to become interactive.
Previously, JavaScript files included in WordPress themes and plugins were loaded without specifying that they should load asynchronously. This meant they blocked other downloads and delayed page rendering while they were fetched and executed.
For website visitors, pages with WordPress content will load faster after an update, specifically improving the CWV’s first contentful paint (FCP) metric, which affects how fast the page first appears.
JavaScript files for blocks like navigation menus and embedded media from WordPress.com now has ‘defer’ added when enqueued. The wp-embed script for displaying embedded posts now utilizes ‘defer.’
Previously, the ability to add these attributes wasn’t standardized. With the introduction of a dedicated API in WordPress 6.3 and the full implementation in 6.4, developers now have a standardized way to control when their scripts load.
Additionally, the update moves the most deferred scripts back into the <head> section since they no longer block rendering. This allows the browser to discover and cache them earlier, improving performance.
A few lower-priority scripts, like the one for comment replies, will remain in the footer but are loaded asynchronously with ‘async’ so they load in parallel with other resources.
For website visitors, pages with WordPress content will load faster after updating. There will be less “jank” or shifting around of page elements after the page first appears.
These changes lay the groundwork for even better optimizations in the future.
Featured Image: Wirestock Creators/Shutterstock
Google Ads announced a number of new features and updates to the ad platform this…
Google Search will soonimages as AI-generated, edited with photo editing software or if…
It looks like we are seeing another surge in the Google Search Console Search Performance…
Some advertisers received an email from Google this week with the subject line, "Changes in…
Before I launched my agency, I worked for several others and noticed a troubling trend.…
Here is a recap of what happened in the search forums today, through the eyes…
This website uses cookies.
Leave a Comment