MainWP Community

Disable Admin Top Bar for all users except Administrator

Use this code snippet to remove the Admin top bar for all users except the administrator on your child sites.

Snippet Type

Execute on Child Sites

Snippet

add_action('after_setup_theme', 'remove_admin_bar');

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