WordPress The Admin Bar (aka "The Toolbar") Removing the Admin Toolbar from all except Administrators

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Add the following code to functions.php to remove it from everyone except the Administrator user level:

add_action('after_setup_theme', 'no_admin_bar');

    function no_admin_bar() {
        if (!current_user_can('administrator') && !is_admin()) {
          show_admin_bar(false);
        }
    }


Got any WordPress Question?