How disable the inline global style added by WordPress since v. 5.9

You may still don’t know that since version 5.9 WordPress inlines the global style needed for Full Site Editing even if you don’t use a theme that is FSE.

This style is around 5 kB, and you absolutely don’t need it in many cases.

If you want to disable it, add these lines of code you the function.php of your child theme or in a functional plugin:

 

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

 

If you want you can also download the plugin Disable Global Style from the official repository.
It’s a matter of a couple of lines of code, but having the plugin you are sure that if in the future the core changes the way to inline the global style, the plugin will be updated.