How To Disable The WordPress Admin Bar

If you have a website where you can have members, chances are you don’t want them accessing the backend of your site in any way (unless they’re an admin). If you’re wondering how to get rid of that pesky admin WordPress bar at the top of your site for anyone that’s just a customer or subscriber, read on.

(Warning: if you are not comfortable editing your sites code, please refrain from doing so until you’re comfortable. We are not responsible for damage done to your site. Feel free to learn about a great plugin called “Code Snippet” that allows you to add to your functions.php without going directly into it – Click here to learn more)

 

Let’s Dive In…

Alright, so, we’re going to go into the dreaded code of your website. To do this, we’re going to first go to Appearance, then we’re going to go to Theme Editor.

Now that you’re in…

Now that you’ve selected Theme Editor, you should see a page with coding. Go ahead and dismiss any notification about ruining your site (BUT PLEASE BE MINDFUL OF IT). Select Theme Functions (functions.php).

You’re doing great!

You should see code that basically takes up all of your screen. Scroll all the way down after you’ve selected theme functions. Copy the following code and paste it all the way at the bottom of your code.

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

And that’s it!

Click update file and you’re done!