Home > Enterprise >  Prevent CSS-Sheet from loading in Wordpress Backend
Prevent CSS-Sheet from loading in Wordpress Backend

Time:01-14

A Plugin i use in Wordpress has a css stylesheet which I only need in the frontend but not in the wordpress backend. (There it causes a small bug)

How can I prevent the stylesheet from loading in the backend? Or the other way around, how can I make a stylsheet load only in the frontend?

Thanks for your help!

CodePudding user response:

With Simple Custom CSS and JS plugin by SilkyPress.com the CSS can be set to appear In Frontend, In Admin or On Login Page separately.

CodePudding user response:

Check slug of imported style and use this solution

// this will remove the stylesheet when init fires
add_action('admin_init','your_remove_default_stylesheets');

// this is your function to deregister the default admin stylesheet
function your_remove_default_stylesheets() {
    wp_deregister_style('wp-admin');
}

Change wp-admin to your slug https://developer.wordpress.org/reference/functions/wp_deregister_style/

  •  Tags:  
  • Related