17 Jul How to Hide the Admin Bar in WordPress
Back in those days, there was no WordPress Admin toolbar. It was all clean and awesome. But, with the release of WordPress 3.3, admin toolbar was introduced.
If you know what I am talking about then you also know the nuances it brings. To be clear, it has some good drawbacks and qualifies for a neat removal. Other than the drawbacks, it does offer a good amount of control over a single post or page. There are many users who find the use of the WordPress Admin toolbar useful, but I bet that a majority of us would want to remove the WordPress admin toolbar.
The WordPress Admin bar is also known for interfering with the theme design and can really cause a distraction for the users.
So, today, I have decided to provide a tutorial on “how to remove the WordPress Admin Toolbar”. This tutorial can be followed by anyone, from novice to ninja.
Table of Contents
How to Remove the WordPress Admin Toolbar
The steps to remove the WordPress admin toolbar is easy. You just need to put the following code into the functions.php file or more specifically site-specific plugin.
To be more specific, the following code will keep the admin bar for the administrator, but will remove it for all other users.
add_action('after_setup_theme', 'remove_admin_bar'); function remove_admin_bar() { if (!current_user_can('administrator') && !is_admin()) { show_admin_bar(false); } }
The above code is easy to understand for veteran WordPress users, but for the novice, it can be a bit complex. Nevertheless, you do not have to understand it for making the WordPress admin toolbar to disable. Just copy-paste the above code and it will work.
Now, let’s remove the admin bar for all the users.
Just copy paste the below code into your functions.php file.
/* Disable WordPress Admin Bar for all users but admins. */ show_admin_bar(false);
Don’t Love Code?
If you do not love code then there are chances that copy-pasting can also become a tedious proposition for you. Don’t worry, you can also remove the Admin Toolbar from the settings.
To remove the toolbar from the settings, first, you need to go to settings, then Users > Your Profile.
Scrolling down will showcase an option, “Show Toolbar when viewing the site.” Uncheck this option for the toolbar to disappear.
And, we are done. No toolbar while viewing the website.
Is there a plugin for this?
WordPress Rocks. Not only because it is famous, but because of the ecosystem it provides for the users. The plugin marketplace has solutions for almost everything, and yes there is a plugin for WordPress admin bar removal/disable.
The plugin that can help you do the same effect as above is Disable WP Admin Bar Removal. If you are in a hurry and do not want to put in some code, then this plugin is for you.
The Disable WP Admin Bar Removal Plugin works for the latest WordPress version and offers better user experience.
According to the plugin author, removal of the admin bar will result in faster page-load speed, reduction in memory consumption and also offers removal of dashboard menu for all the subscribers.
Should you go for the plugin for the manual removal?
The answer depends on your usage and what you are trying to accomplish. The plugin, for example, offers a clean dashboard for subscribers, and you may not need it for your website, so it is better to go with the code method.
Also, using a plugin adds a simple overhead for processing to the WordPress website. This can slow down the whole process and eventually make things worse for you. So, it is always better to go the simple route of using the code method.
But, if you are really paranoid with the code method, you can just opt for the WordPress plugin and be done with the WordPress admin bar. The plugin simple and will not impact the loading time that much.
Wrap Up
Clearly, there are many ways to remove the annoying WordPress Admin bar. I would advise not to remove the admin bar for the administrator because the admin bar is really useful for the admin.
With 3 distinct methods, code method, settings method and plugin method, I think I did justice to the topic and solved the problem for you.
Do, you think the same way? Comment below and let us know.
Also, do not forget to share the article as much as you can.
No Comments