This post was last updated on March 28th, 2022 at 04:29 am
add_filter( 'show_admin_bar', 'hide_admin_bar_from_non_admins'); function hide_admin_bar_from_non_admins() { return ! ( ! current_user_can( 'manage_options' ) ); }
Disable Admin Bar for All Users
To disable it for all users, then simply put use this code in your theme’s functions.php file.
/* Disable WordPress Admin Bar for all users. */ add_filter('show_admin_bar', '__return_false');
My Plugin to Hide or disabled WordPress Admin Bar.
This plugin will help to hide or disable WordPress admin bar for all user or based on selected user roles and user capabilities.
Leave A Reply