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

WordPress Trac noreply at wordpress.org
Thu Jun 4 10:23:45 UTC 2026


#65336: global-styles-inline-css cannot be removed since 7.0
-------------------------------------------------+-------------------------
 Reporter:  edent                                |       Owner:
                                                 |  westonruter
     Type:  defect (bug)                         |      Status:  accepted
 Priority:  normal                               |   Milestone:  7.0.1
Component:  General                              |     Version:  7.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests reporter-   |     Focuses:  css
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by wildworks):

 To prevent the enqueuing of global styles CSS in WordPress 7.0, you can
 use either of the following code snippets:

 {{{
 add_action( 'after_setup_theme', function () {
         remove_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' );
         remove_action( 'wp_footer', 'wp_enqueue_global_styles', 1 );
 } );
 }}}

 {{{
 add_action( 'wp_footer', function () {
         wp_dequeue_style( 'global-styles' );
 }, 2 );
 }}}


 Personally, I'm unsure if we should be responsible for backward
 compatibility regarding CSS enqueue changes. Similar modifications should
 have been made many times in the past.

 I'm not sure if it's worth adding such special handling to
 `wp_enqueue_global_styles()` for the sake of backward compatibility.

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


More information about the wp-trac mailing list