Dequeue Gutenberg Block Library Styles

Removes default Gutenberg styles to reduce frontend asset loading.

PHP
/**
 * Snippet Name:     Dequeue Gutenberg Block Library Styles
 * Snippet Author:   coding-bunny.com
 * Description:      Removes default Gutenberg styles to reduce frontend asset loading.
 */

add_action( 'wp_enqueue_scripts', 'cb_dequeue_gutenberg_styles', 110 );

function cb_dequeue_gutenberg_styles() {
    // Dequeue default Gutenberg block library styles.
    wp_dequeue_style( 'wp-block-library' );

    // Dequeue default Gutenberg block theme styles.
    wp_dequeue_style( 'wp-block-library-theme' );
}

How To Implement This Solution?

Leave a Reply

Your email address will not be published. Required fields are marked *

My Agile Privacy
This site uses technical and profiling cookies. You can accept, decline or customize cookies by pressing the desired buttons. By closing this policy you will continue without accepting.

Need help?

Choose one of the following options:

Powered by CodingBunny