As you login to your WordPress admin dashboard, one of the first things you’ll notice is the WordPress admin bar which is located at the very top of the webpage. WordPress Admin toolbar is useful because it contains multiple handy quick-links that can be used for various purposes, such as creating new posts, pages, items, or for accessing the documentation, etc. Just like you can customize your WordPress theme, you can modify even the admin toolbar, depending on your preferences.
However, some people find it totally distracting and would rather remove it altogether from the screen. Website developers and, in particular WordPress editors, have a strong dislike for it, as it can often change the overall look of the page they are currently creating or editing.
If you want to get rid of WordPress Admin bar but have no idea how, don’t worry. In this guide we’ll show you, how you can hide or disable WordPress Admin bar.
1- Hide WordPress admin bar using WordPress plugin
You can download and install Admin Bar Disabler WordPress plugin to disable WordPress admin bar.
2- Hide WordPress admin bar using CSS
Hiding wordpress admin bar using CSS is one of the quickest and easiest way. To hide wordpress admin bar, login to wordpress dashboard and navigate to Appearance->Customize-> Additional CSS and add following CSS
#wpadminbar {
display:none !important;
}
You can also add above CSS in your theme style.css file.
3- Hide WordPress admin bar for all users using PHP code
WordPress admin bar can also be disabled easily using PHP code. For this purpose you can also hire an experienced WordPress developer. You can also do this by adding following code in your current theme functions.php file
add_filter('show_admin_bar', '__return_false');
4- Hide WordPress admin bar for non admin users only using PHP code
WordPress Admin bar can be hidden using PHP for non admin users only. For hiding wordpress admin bar for non admin users, add following code in your current theme functions.php file
add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
That’s all, folks! After using above methods WordPress admin bar won’t bother you any longer. In case you want to remove or disable wordpress admin bar, we showed you how to do it easily in simple ways, without breaking a sweat. Now that you’ve eliminated all distractions, you can enjoy creating some great WordPress pages. If you still need any help or you need to hire a WordPress development professional, feel free to contact us.