How to Control your WordPress Admin Bar

WordPress

If you run, or are working on, a membership WordPress site with multiple user levels, you may not want some users to have access to the admin bar – say, for example, all the information they need is already supplied on the front-end.

Having control over the Admin Bar will ensure the only people that can see/use this feature are the ones that you allow.

In this guide, we will show you how to control how and when the Admin Bar is displayed on your website.

Installing WP Custom Admin Bar

If you have a problem that needs solving on WordPress, then there is generally a plugin for the job and this task is no different. To gain full control of the Admin Bar we are going to be using the very useful WP Custom Admin Bar plugin.

To install this plugin go to Plugins > Add New and enter ‘WP Custom Admin Bar’ in the search field. When WordPress has found it, click on Install Now and Activate Plugin once a successful install has been completed.

Once activated, WP Custom Admin Bar will install an extra tab in your settings. To configure the plugin according to your preferences go to Settings > Custom Admin Bar.

Here you will have the ability to select which users can see the admin bar by user level (Administrator, Editor, Author, and Contributor) and add custom CSS styles to control the appearance of the Admin Bar. Alternatively – should you choose to – you can just remove the Admin Bar completely.

Disabling the Admin Bar for Users without a Plugin

If you want to permanently disable the Admin Bar for all users expect Administrators, you can do so by editing the functions.php file of your theme. You can do this by going to Appearance > Editor and clicking on the functions.php file from the right sidebar, or by navigating to wp-content/themes/yourtheme via your preferred FTP client.

To disable the Admin Bar for all users, add the following code to functions.php:

/* Disable WordPress Admin Bar for all users but admins. */

show_admin_bar(false);

To disable the Admin Bar for all users expect Administrators, use this code instead:

add_action('after_setup_theme', 'remove_admin_bar');

function remove_admin_bar() {

if (!current_user_can('administrator') && !is_admin()) {

show_admin_bar(false);

}

}

While using the WP Custom Admin Bar is the preferred method and will allow you to remove the Admin Bar completely if required, plugins are not always a permanent solution. If you change your theme or update your WordPress installation, there is always a chance of a plugin not working correctly. If this is ever the case, editing the functions.php file will ensure you still have control over the Admin Bar.

Share it!Share on FacebookTweet about this on TwitterShare on Google+Email this to someone

Our Recommended Wordpress Web Hosting Provider

WordPress

WHC.CA
Get a 50% Discount by using our link.

WHC.ca

Reliable host, with excellent customer service and an easy one-click Wordpress installation. Our recommendation to host a Wordpress blog.

Leave a Reply

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