If you want to hide or remove admin bar from users in the WordPress site than simply put the following code into the theme’s function.php file or your active plugin.

add_action('after_setup_theme', 'remove_admin_bar');

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

By applying the above code admin bar will be disabled or removed from the users in front end site except Administrators.

There are currently no comments.