How to Remove the WordPress Admin Toolbar From Your Site
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.
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.
Turn Off the Admin Toolbar in 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:
This code will stop the toolbar from displaying on the front-end of your site.