Looking to remove global-styles CSS, which was added by WordPress version 5.9? Follow this how-to guide to make your page AMP friendly.
1 answers
1
Deregister global-styles
In your theme’s functions.php file, you need to may need to add the following code to remove the CSS stylesheet.
function remove_gutenberg_styles() {
wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'wp-block-library-theme' );
wp_dequeue_style( 'wc-block-style' );
wp_dequeue_style( 'global-styles' );
}
add_action( 'wp_enqueue_scripts', 'remove_gutenberg_styles', 100 );
— Support WizardAnswer 1