Home > Back-end >  how to remove wp-includes/css/classic-themes.min.css?
how to remove wp-includes/css/classic-themes.min.css?

Time:11-08

after upgrade to wordpress 6.1, there is a new style link in head, the link is domain.com/https://www.example.com/wp-includes/css/classic-themes.min.css?ver=1, and the content is

/*! This file is auto-generated */
.wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em   2px) calc(1.333em   2px);font-size:1.125em}

how to remove it? Thank you

i tried searched but there is no answer in google. maybe its a new question.

CodePudding user response:

Check the source code of your website and get the id of that stylesheet. it may look like this.

<link rel='stylesheet' id='classic-theme-styles-css' href='https://example.com/wp-includes/css/classic-themes.min.css?ver=1' media='all' />

then your id will be classic-theme-styles and use wp_dequeue_style().

add_action( 'wp_enqueue_scripts', 'mywptheme_child_deregister_styles', 20 );
function mywptheme_child_deregister_styles() {
    wp_dequeue_style( 'classic-theme-styles' );

}

Reference: https://developer.wordpress.org/reference/functions/wp_dequeue_style/

  • Related