How To Remove wp-block-library (Gutenberg)

Looking to remove wp-block-library-css, which was added by Gutenberg? Follow this how-to guide to make your page AMP friendly.

Deregister wp-block-library

In your theme’s functions.php file, you need to may need to add the following code to remove the CSS stylesheet.

function remove_gutenberg_styles() {
     wp_dequeue_style( 'wp-block-library' );
     wp_dequeue_style( 'wp-block-library-theme' );
     wp_dequeue_style( 'wc-block-style' );
}

add_action( 'wp_enqueue_scripts', 'remove_gutenberg_styles', 100 );

Looking to remove global-styles too?

You can find the answer to remove global-styles CSS here.