---
description: https://smartwp.com/remove-gutenberg-css/
---

# Remove the Gutenberg Block Library CSS from WordPress (ok)



The new WordPress editor Gutenberg which was included in [WordPress 5.0](https://wordpress.org/news/2018/12/bebo/) has been loathed by many WordPress users. Whether you’re a fan or not millions have been moved to the new WordPress editor.

If you’re addicted to making your WordPress site as fast as possible you may have noticed a bit of CSS from Gutenberg. Every request on your site will slightly slow down your pages so if you’re not using Gutenberg you’ll want to **remove Gutenberg CSS**.

This provides support to blocks but if you are using the [classic editor](https://wordpress.org/plugins/classic-editor/) you most likely don’t want it loading with your pages. I noticed the “block-library/style.min.css” file loading even though I exclusively use the classic editor.Block library style.min.css CSS loading on all WordPress pages

![](https://smartwp.com/wp-content/uploads/2019/07/block-library-css-1024x182.jpg)

You can remove Gutenberg CSS by using the PHP below to dequeue the “/wp-includes/css/dist/block-library/style.min.css” file.

**Note**: If you are using Gutenberg editor do not add this to your site.

```
<?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' );
}
add_action( 'wp_enqueue_scripts', 'smartwp_remove_wp_block_library_css' );
```

This PHP will work in your functions.php file or being added using a plugin like [Code Snippets](https://wordpress.org/plugins/code-snippets/).

[view raw](https://gist.github.com/someguy9/1f51a7cb3349cc32d00f5aaa5d3b3e19/raw/41be90340aa82c30b80a1355b89f8cdfd887a294/wp-remove-gutenberg-block-library-css.php)[wp-remove-gutenberg-block-library-css.php](https://gist.github.com/someguy9/1f51a7cb3349cc32d00f5aaa5d3b3e19#file-wp-remove-gutenberg-block-library-css-php) hosted with ❤ by [GitHub](https://github.com/)

If you ever decide to use the Gutenberg editor just remember to remove this snippet since it’ll affect your blocks.

**Andy Feliciotti**

Andy has been a full time WordPress developer for over 10 years. Through his years of experience has built 100s of sites and learned plenty of tricks along the way.

#### 3 Responses

1.  ![](https://smartwp.com/wp-content/uploads/optimum-gravatar-cache/0.svg)**faruk yetkin** says:[September 22, 2019 at 7:52 am](https://smartwp.com/remove-gutenberg-css/#comment-101)

    `// Alternative`\
    `// Fully Disable Gutenberg editor.`\
    `add_filter('use_block_editor_for_post_type', '__return_false', 10);`\
    `// Don't load Gutenberg-related stylesheets.`\
    `add_action( 'wp_enqueue_scripts', 'remove_block_css', 100 );`\
    `function remove_block_css() {`\
    `wp_dequeue_style( 'wp-block-library' ); // WordPress core`\
    `wp_dequeue_style( 'wp-block-library-theme' ); // WordPress core`\
    `wp_dequeue_style( 'wc-block-style' ); // WooCommerce`\
    `wp_dequeue_style( 'storefront-gutenberg-blocks' ); // Storefront theme`\
    `}`
