[wp-trac] [WordPress Trac] #65336: global-styles-inline-css cannot be removed since 7.0

WordPress Trac noreply at wordpress.org
Mon May 25 07:36:42 UTC 2026


#65336: global-styles-inline-css cannot be removed since 7.0
--------------------------+-----------------------------
 Reporter:  edent         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  7.0
 Severity:  normal        |   Keywords:
  Focuses:  css           |
--------------------------+-----------------------------
 I recently upgraded to 7.0.  This has caused `global-styles-inline-css` to
 be forcibly injected into my blogs's <head>. This breaks some of my
 styles.

 Previously, I was able to put the following in my theme to remove global-
 styles-inline-css - but this no longer works.

 {{{#!php
 <?php
 add_action( "wp_enqueue_scripts", "remove_global_styles" );
 function remove_global_styles() {
         wp_dequeue_style( "global-styles-inline" );
 }

 remove_action( "wp_enqueue_scripts", "wp_enqueue_global_styles" );
 }}}

 Neither of those work. I do not use blocks. I have removed Gutenberg.

 {{{#!php
 <?php
 function remove_wp_block_library_css():void {
         wp_dequeue_style( "wp-block-library" );
         wp_dequeue_style( "wp-block-library-theme" );
         wp_dequeue_style( "wp-components" );
 }
 add_action( "wp_enqueue_scripts", "remove_wp_block_library_css", 100 );
 }}}

 This appears to be a regression. Previously it was possible to remove the
 unwanted and unnecessary CSS. Now it is not.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/65336>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list