How to Remove the WordPress Admin Toolbar with Code
Either way, it’s easy to disable the toolbar. In this Weekend WordPress Project I’ll show you a couple of ways to remove it from your site’s front-end – in WordPress settings and also with code.
Disable the WordPress admin toolbar in today’s Weekend WordPress Project.
Turn Off the Admin Toolbar in Settings
Disable the admin toolbar in your profile settings.
To remove the toolbar from your site, go to Users > Your Profile. Scroll down to “Toolbar” and check “Show Toolbar when viewing site.”
And that’s all you need to do. The Toolbar will no longer appear on your site.
While the toolbar will stop displaying on the front-end of your site, it will continue to show on the backend of your site. It’s best to leave the backend toolbar as it is – it does contain important information about your site, after all.
Remove the Admin Toolbar with Code
If you would rather remove the toolbar with code, just drop the following snippet into your functions.php file:
add_filter('show_admin_bar', '__return_false’);
This code will stop the toolbar from displaying on the front-end of your site.
About WordPress Admin Toolbar
"WordPress automatically displays a toolbar at the top of the page
when you’re logged in. Whether you’re viewing the WordPress dashboard or
the front page of your site, it’s still there – and for many people
it’s an annoyance.
For developers, the toolbar can
slightly throw off a theme’s design, especially if you have some CSS
styling that may not be visible if the admin bar is displayed. For
others, the toolbar is just distracting."
Comments[ 0 ]
Post a Comment