WordPress Snippets

How to Remove WordPress Admin Toolbar

By ThemesDNA1 min read

Share:

Unless users have disabled it from settings, WordPress automatically shows an admin toolbar at the top of the page for logged-in users.

Add this code to the functions.php file in your theme to hide/remove WP admin toolbar:

add_filter('show_admin_bar', '__return_false');

Alternative code: If you want, the below code can also be used to hide the WordPress admin toolbar from the front-end instead of the above code.

function themesdna_remove_admin_bar() {
    show_admin_bar(false);
}
add_action('after_setup_theme', 'themesdna_remove_admin_bar');

Don't forget to save the functions.php.

Premium WordPress themes One-time payment   /   Lifetime updates

Ready to Build?

Get the ThemesDNA bundle.

Get all premium ThemesDNA themes with lifetime updates and unlimited website usage for a one-time payment.

  • 56 premium themes
  • Lifetime updates
  • Unlimited websites
  • No renewals

The complete premium theme bundle

$75

One payment. No renewals.

Get the ThemesDNA Bundle — $75