disable admin bar wordpress

PHP
/* Disable WordPress Admin Bar for all users */
add_filter( 'show_admin_bar', '__return_false' );/* Disable WordPress Admin Bar for all users */
add_filter( 'show_admin_bar', '__return_false' );
add_action('after_setup_theme', 'remove_admin_bar');
 
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
}
}

Source

Also in PHP: