Title: Dequeue wp-block-library-css
Last modified: August 19, 2024

---

# Dequeue wp-block-library-css

 *  Resolved Anonymous User 13711045
 * (@anonymized-13711045)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/dequeue-wp-block-library-css/)
 * I’ve got the option enabled to disable Gutenberg and “Also disable frontend block
   styles / CSS files for the selected post types.”. However, the “wp-block-library-
   css” stylesheet is still being loaded. Would be good for it to be removed if 
   this option is enabled.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Bowo](https://wordpress.org/support/users/qriouslad/)
 * (@qriouslad)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/dequeue-wp-block-library-css/#post-17963179)
 * Which theme / page builder are you using?
 *  Thread Starter Anonymous User 13711045
 * (@anonymized-13711045)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/dequeue-wp-block-library-css/#post-17964360)
 * Bricks. I found that adding “wp_deregister_style( ‘wp-block-library’ )” in the“
   wp_enqueue_scripts” action removed it. Not sure if something changed, but that
   worked.
 *  Thread Starter Anonymous User 13711045
 * (@anonymized-13711045)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/dequeue-wp-block-library-css/#post-17980532)
 * So I looked into this some more, and it looks like if you can just add “wp_deregister_style(‘
   wp-block-library’)” to “disable_gutenberg_for_post_types_frontend” function within“
   Disable_Gutenberg” class and that would work. Also, I was looking in that class
   and I think you have a typo in there. The actual function is plural.
 * [https://share.cleanshot.com/qhm4bq0C](https://share.cleanshot.com/qhm4bq0C)
 * Additionally, I’d like to remove the global styles inline CSS if possible. I 
   found you have to do it this way.
 * `function remove_global_styles_inline_css() {
    remove_action('wp_enqueue_scripts','
   wp_enqueue_global_styles');}add_action('init', 'remove_global_styles_inline_css');
    -  This reply was modified 1 year, 9 months ago by Anonymous User 13711045.
 *  Plugin Author [Bowo](https://wordpress.org/support/users/qriouslad/)
 * (@qriouslad)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/dequeue-wp-block-library-css/#post-17995684)
 * @thekendog thanks for the more detailed follow up as well as the code. When I
   tried plugging your code, it still doesn’t work. Then I realized that the $post
   variable sometimes return a null. When I change how that variable is defined,
   both ‘wp-block-library’ and the inlined ‘global-styles-inline-css’ are both removed
   properly. This fix will be included in the next release (next Monday). Please
   test when you see it.
 * One other thing… if you find ASE useful for your work / site(s), please consider
   leaving a quick, 5-star review at [https://wordpress.org/plugins/admin-site-enhancements/#reviews](https://wordpress.org/plugins/admin-site-enhancements/#reviews),
   which will also help others find ASE as they search for new plugins to install.
   Thanks.
 *  Plugin Author [Bowo](https://wordpress.org/support/users/qriouslad/)
 * (@qriouslad)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/dequeue-wp-block-library-css/#post-17995694)
 * p.s. the typo in the function name will also be fixed. Good catch! Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Dequeue wp-block-library-css’ is closed to new replies.

 * ![](https://ps.w.org/admin-site-enhancements/assets/icon-256x256.png?rev=3099794)
 * [Admin and Site Enhancements (ASE)](https://wordpress.org/plugins/admin-site-enhancements/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/admin-site-enhancements/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/admin-site-enhancements/)
 * [Active Topics](https://wordpress.org/support/plugin/admin-site-enhancements/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/admin-site-enhancements/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/admin-site-enhancements/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Bowo](https://wordpress.org/support/users/qriouslad/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/dequeue-wp-block-library-css/#post-17995694)
 * Status: resolved