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 Made for WordPress   /   Ready for your story

Ready to Build?

Your next great website starts here.

Build more websites with one flexible collection—and keep every theme for life.

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

The complete collection

$75

One payment. No renewals.

Get the Themes Bundle — $75