Disable admin bar for all users except administrator


Description: 

Put code in functions.php in child theme.

 

If you want to hide it for all users:

  show_admin_bar(false);



Kind:

PHP


PHP:

// Disable admin bar for all users except for admin

add_action('after_setup_theme', 'remove_admin_bar');

function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}