How to Hide/Remove Admin Bar in WordPress (Toolbar & User Bar)

Have you ever felt annoyed by the WordPress menu bar when viewing a site? Especially when you’re developing WordPress theme, the top toolbar seems to often get in the way. In this article, we will show you three simple ways on how to temporarily or permanently get them away from your eyesight. It takes less than two minutes and you can bring it back anytime.

How to Hide Admin Bar Only for Yourself

If you’re a solo blogger or running a website on your own, you may only need to hide the admin bar only for yourself. It’s very easy to do since the option is already built right into your WordPress profile setting page.

  1. Login to Admin area
  2. Go to Users -> Your Profile
  3. Uncheck  Show Toolbar when viewing site

This will remove a toolbar from frontend when viewing a site but a toolbar in the administrator area will still exist.

How to Hide Admin Bar for All Users Except Administrator

In some cases, you may find admin bar to be useful and decided to have it around. The code below will only hide admin bar from any users that have no administrative role.

  1. Access your theme’s folder with FTP Client or use the WordPress Theme Editor
  2. Open functions.php file and paste down the code below
  3. Save and Re-upload the file.
add_action('after_setup_theme', 'hide_admin_bar');

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

How to Hide Admin Bar for All Users

Follow the previous instruction and use the code below will force WordPress to hide admin bar from all users no regarding of their roles.

// Remove Admin Bar for All Users
show_admin_bar(false);
Share this content!
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •