Remove toolbar option (and set to default to no) in user profile

I don’t want users to be able to choose to display the admin bar/toolbar when they log into wordpress. It doesn’t have a function for those users.

Instead I would like for admin users to have the toolbar shown by default and anyone else to have the toolbar hidden by default.

I can do this with a plugin by using css and all sorts to hide the toolbar and the option in the profile, however I was wondering if there was a “proper” way to do this at all?

Thanks

3 Answers
3

To set the default to not show the admin bar on the public side at registration put the following in your theme’s functions.php file (note: this will only work for new users, you’ll have to manually disable it for all your current users via the Dashboard):

// Disable the user admin bar on public side on registration
add_action('user_register','trash_public_admin_bar');
function trash_public_admin_bar($user_ID) {
    update_user_meta( $user_ID, 'show_admin_bar_front', 'false' );
}

Leave a Comment