Inline Small Block Stylesheets Instead of Loading Files
Lets WordPress print more of the small per-block stylesheets directly in the page instead of as separate files, which saves several network requests on pages with many different blocks.
Opens WPIDE on
Code
// Total bytes of block CSS WordPress may inline per page (the default is 20000).
$wpide_inline_budget = 40000;
add_filter( 'styles_inline_size_limit', function () use ( $wpide_inline_budget ) {
return (int) $wpide_inline_budget;
} );
Notes
Works together with loading block styles separately; raise or lower the byte budget to balance page size against request count.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.