0

I don't want to fully disable the admin bar. I just want to remove its css file so I can fully customize it myself without having to override anything with greater selectors or a load of !important

The exact file name that is being loaded is admin-bar.min.css and then along with the Wordpress version ?ver=[...]

1

This Should do the trick

<?php 
function adminBar_dequeue() {
    wp_dequeue_style('admin-bar');
    wp_deregister_style('admin-bar');
}

add_action( 'wp_enqueue_scripts', 'adminBar_dequeue', 9999 );
add_action( 'wp_head', 'adminBar_dequeue', 9999 ); 

?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.