WordPress admin bar is very useful for most people, they can access some of the important menu easily from any page. But sometimes in certain cases you might want to hide the admin bar from your users.
So, here’s a way to hide admin bar in WordPress. Just put this code anywhere in your functions.php file.
show_admin_bar(false);
If you only want to show admin bar to users who have administrative privileges you can use this code:
if ( ! current_user_can( 'manage_options' ) ) { show_admin_bar( false ); }
If you want to hide the admin bar only in the frontend and keep it displaying in WordPress Dashboard you can use this code:
add_filter('show_admin_bar', '__return_false');