Hide WordPress Admin Toolbar to Logged in Users

You can hide the WordPress admin toolbar to logged in users based on their user role and capabilities. First of all you can hide the toolbar on all front end pages from all users by adding to your functions.php

show_admin_bar( false );

Lets say you wanted regular subscriber users not to see the toolbar when logged in your themes functions.php you can add …

if ( ! current_user_can( 'remove_users' ) ) {
 show_admin_bar( false );
}

The above is saying if the current user does not have the capability to remover users then don’t show the tool bar. A list of roles and user capabilities is found here.

Ref

Leave a Comment





%d bloggers like this: