How To Hide WordPress Admin Bar On Frontend & Vice Versa?

WordPress admin bar provides you admin area links connecting the back end of your website to the frontend. This toolbar, present on the top of every WordPress installation is very useful for accessing quick website management features. Still, sometimes it doesn’t looks great on the frontend of every website.

In this lesson you will learn about hiding it completely or under certain defined conditions on your website.

By using the following hack, you can disable WP Admin Bar for all users excluding site admins. Simply, open your theme’s function.php file and add the following code:

if (!current_user_can(‘administrator’)):
show_admin_bar(false);
endif;

VIA PLUGIN – Or install and activate plugin Hide Admin Bar from Non-Admins. Once activated the plugin automatically hides admin bar for non-admin users.

In-case you want to remove admin bar for all users including admins then add this code in your theme’s function.php file:

show_admin_bar(false);


How To Hide WordPress Admin Bar On Frontend?

Another plugin called Hide Admin Bar, automatically disables the WordPress admin bar on frontend, both for logged in and logged out users on your website. Among the tricks suggested above, this plugin provides you the fastest way to disable admin bar on frontend. Once activated; it automatically does this thing.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.