How to Remove Gutenberg Block CSS from WordPress

WordPress’s default editor, Gutenberg, automatically adds a CSS file to manage front-end blocks.

For example:

<link rel='stylesheet' id='wp-block-library-css' href='/wp-includes/css/dist/block-library/style.min.css' type='text/css' media='all' />

However, if you are not using Gutenberg – you may want to remove this additional stylesheet to lessen server requests.

The following PHP code will stop this file from being loaded on your side.

WordPress PHP Script

If you’re not sure where to place this code I highly recommend you read How to create a WordPress plugin for your custom functions.

function itsg_remove_block_library_css(){
    wp_dequeue_style( 'wp-block-library' );
} 
add_action( 'wp_enqueue_scripts', 'itsg_remove_block_library_css' );