Keep track of where you left off & more. Sign up today

Hide WordPress admin bar for non admins

Put this in your themes functions.php
                add_action('set_current_user', 'cc_hide_admin_bar');
function cc_hide_admin_bar() {
  if (!current_user_can('edit_posts')) {
    show_admin_bar(false);
  }
}
            

Other Snippets

View all Snippets