Remove the Gutenberg Block Library CSS from WordPress

Marko Krstić
28 May 2022

Note: Do not use this if you want to use Gutenberg. Only if you are using Classing editor.

If you are using Scripts Organizer set it as Code block, Trigger location > Everywhere.

<?php

//Remove Gutenberg Block Library CSS from loading on the frontend
function smartwp_remove_wp_block_library_css(){
    wp_dequeue_style( 'wp-block-library' );
    wp_dequeue_style( 'wp-block-library-theme' );
    wp_dequeue_style( 'wc-blocks-style' ); // Remove WooCommerce block CSS
} 
add_action( 'wp_enqueue_scripts', 'smartwp_remove_wp_block_library_css', 100 );

?>

Was this article helpful?

Tags

Categories

Never miss new post again

Subscribe and get list of new posts in your inbox

Click to Copy