[+] How to dequeue Toolset Blocks script frontend.js

The Toolset Blocks script frontend.js isn’t enqueued normally, an inline script is added to the page to load the script asynchronously.

Likewise the Toolset stylesheet toolset-blocks/vendor/toolset/blocks/public/css/style.css.

This mechanism can be disabled by adding the following constant to wp-config.php:


define( 'TB_SCRIPT_STYLE_LAZY_LOAD', false );

Then the script or stylesheet itself (both with the handle ‘toolset-blocks’) can be dequeued normally, e.g. for the script:


add_action( 'wp_print_scripts', 'ts_debug_scripts' );
function ts_debug_scripts( $handles ){

wp_dequeue_script( 'toolset-blocks' );
}


Support Thread Example

Let us know if this snippet is not working for you:

This snippet doesn’t work
0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Christian Cox
3 years ago

To also dequeue the blocks CSS file, a client reports you can add the following code in the ts_debug_scripts function:

wp_deregister_style('toolset-blocks');