Admin Bar CSS left over after removal

To completely remove the Admin bar deregister the js and css using wp_degregister_script and remove the action.

if (!is_admin() && !current_user_can('add_users')){
    wp_deregister_script( 'admin-bar' );
    wp_deregister_style( 'admin-bar' );
    remove_action('wp_footer','wp_admin_bar_render',1000);
}

Leave a Comment