How to Hide WordPress Admin Bar When Logged In


Nowadays WordPress has a very powerful admin bar, with which one can easily handle all its powerful features. They can access many of WordPress’s important parts from any page.

But sometimes in certain cases you might want to permanently hide the admin bar because you might not want users seeing the admin bar every time they visit your site.

Hiding the admin bar is pretty simple. These codes need to be placed in your theme’s functions.php.

Code snippets to hide WordPress admin bar

Hide admin bar for all logged in users:

add_filter('show_admin_bar', '__return_false');

Hide admin bar for all logged in users which have admin privileges:

if ( ! current_user_can( 'manage_options' ) ) {
    add_filter('show_admin_bar', '__return_false');
}

Hide admin bar from all pages in WordPress including from WordPress dashboard.

sow_admin_bar(false);

That’s it, don’t forget to save your functions.php file after making the changes.

 2,344 total views,  1 views today

Leave a Comment

Your email address will not be published. Required fields are marked *