Learn in this tutorial how to enable block styles to load separately in WordPress using code.
WordPress 5.8 introduces quite a few new features, including an improvement to how block styles are loaded.
Specifically, this enhancement allows only the styles of the blocks that are being used on the page to be loaded.
Until now, by default, the styles of all native WordPress blocks were loaded on all pages.
You can imagine that this is quite an interesting performance improvement, but to take advantage of it you have to activate it.
Here’s how:
Snippet to enable independent loading of WordPress block styles
Add the following snippet to the functions.php file:
To see this and another 1097 code snippets of this website, login or subscribe here.
It’s as simple as that.
Conclusions
Now you know how to enable WordPress native block styles to load separately.
Thanks to this, the page will only load the styles of the blocks present on the page with the performance improvement that this entails.
Any questions? I read you in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉