Remove WordPress global styles not working

When I toggle on remove Wordpress global styles in the advanced settings, they are still output in the HTML as screenshot below, what am I missing here please?

Also tick Duotone filters

@anon32808828 - yes I toggled on remove SVG filters and Emojis also but they all still appear in the markup, I have rebuilt HTML and CSS too, but they still output in the HTML?

I see. I use the following code myself. You may try it.

function jwarnox_improve_performance(){
    wp_dequeue_style( 'wp-block-library' ); // Remove gutenberg styles
    wp_dequeue_style( 'global-styles' ); // Remove gutenberg inline css
 	  wp_dequeue_style( 'wc-blocks-style' ); // Remove woocommerce block styles
 	  wp_dequeue_style( 'woocommerce-inline' ); // Remove woocommerce inline styles
    remove_action( 'wp_head', 'wc_gallery_noscript' ); // Remove woocommerce gallery script
 	  remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' ); // Remove inline gutenberg svg filters
	  remove_action( 'wp_head', 'wp_resource_hints', 2 ); // Remove dns preloading for wp site
 	  remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); // Remove emoji
    remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); // Remove emoji
    remove_action( 'wp_print_styles', 'print_emoji_styles' ); // Remove emoji
    remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); // Remove emoji
    remove_action( 'admin_print_styles', 'print_emoji_styles' ); // Remove emoji
    remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); // Remove emoji
    remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); // Remove emoji
    add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' ); // Remove emoji from tinymce
add_action( 'wp_enqueue_scripts', 'jwarnox_improve_performance', 9999 );

Thanks @anon32808828 - worked great!

1 Like

Just a small feedback from my side.
No issues on my installation, all 3 optimization settings do work properly and as intended.

Clearing cache / browser hard refresh might help @jwarnox.

1 Like

@marius yes, hard refresh worked and those optimisation settings are indeed working now, thanks for the advice.