# Load Block Styles Only for Blocks on the Page

> Replaces the single large block stylesheet with small per-block styles that load only when a block is actually used, which helps classic themes most.

- Type: PHP
- Runs: Run everywhere
- Category: [Performance](https://wpide.com/library/category/performance/)
- Tags: performance, css, blocks
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/load-block-styles-separately/

## Code

```php
add_filter( 'should_load_separate_core_block_assets', '__return_true' );
```

## Notes

Block themes already do this; on classic themes, check pages with widgets or page builders afterwards.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Load Block Styles Only for Blocks on the Page" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
