metinsaylan // rogue developer

WordPress: Hide/Disable Admin bar for all users except admins

//

Admin bar is the dark bar with buttons to add content, and manage updates, comments. For regular users, this bar sometimes becomes confusing. To easily hide admin bar, add the following snippet to your functions.php file:

function remove_admin_bar() {
  if (!current_user_can('administrator') && !is_admin()) {
    show_admin_bar(false);
  }
} add_action('after_setup_theme', 'remove_admin_bar');
Search WordPress: Hide/Disable Admin bar for all users except admins on Google