# Script File loads in Editor although it is not linked via "Editor Script"

**URL:** <https://forum.pinegrow.com/t/script-file-loads-in-editor-although-it-is-not-linked-via-editor-script/7202>\
**Category:** Pinegrow WP\
**Tags:** bug\
**Created:** [November 15, 2022, 11:55am UTC](https://forum.pinegrow.com/t/script-file-loads-in-editor-although-it-is-not-linked-via-editor-script/7202 "2022-11-15T11:55:35Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)\
**Post date:** [September 26, 2023, 12:10pm UTC](https://forum.pinegrow.com/t/script-file-loads-in-editor-although-it-is-not-linked-via-editor-script/7202/16 "2023-09-26T12:10:23Z")

</div>

@MichelyWeb @Wolfgang.Hartl, well, this was enlightening 🙂

By default, WordPress loads styles and scripts of all registered blocks on the front-end, regardless if blocks are used on the page or not. It appears the change happened in WP 5.8.

To load only assets of blocks that are used on the page, add the following code to `inc/custom.php`:

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

```

Starting from Pinegrow Web Editor 7.8, WordPress plugin 1.0.15 and Theme Converter 2.2 (next updates) the WordPress builder can do this for you if you enable the **Load only styles and scripts of blocks that are displayed on the front-end** checkbox in project settings:

[![](https://docs.pinegrow.com/wp-content/uploads/load.block_.assets.at_.render.jpg)](https://docs.pinegrow.com/wp-content/uploads/load.block_.assets.at_.render.jpg)

I added the above to our docs on block styling and scripts:

> **[Custom Blocks Styling and Scripts | Pinegrow Web Editor](https://pinegrow.com/docs/wordpress/creating-custom-wordpress-blocks/styling-the-blocks/)**
>
> How to add custom styling to our blocks?

---

_[View the full topic](https://forum.pinegrow.com/t/script-file-loads-in-editor-although-it-is-not-linked-via-editor-script/7202)._
