WP Admin Bar

The WordPress admin bar is a very handy and useful feature it allows you to easily edit front end content, or access certain plugins functions quickly. That being said it can also be an eyesore, it slows down the website and if you are only ever in the back end why do you want it enabled all the time?

There are a number of ways to remove the admin bar but the easiest is to simply add this code snippet to your functions.php file (of a child theme) or a site specific plugin so it won’t display on your front end anymore.

add_filter('show_admin_bar', '__return_false');

Now there are some cases where you don’t want to show itĀ for your subscribers, and other logged in users but you as the administrator still want to be able to access it. The following snippet will only show it for admin users.

add_action('after_setup_theme', 'remove_admin_bar');

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

Now you can quickly and effectively disable the admin bar based for everyone or just the non-administrative staff on your WordPress website!

LEAVE A REPLY

Please enter your comment!
Please enter your name here