How to easily hide the admin panel for WordPress users

Last updated December 6th, 2023 00:01

One of the features of WordPress administration is the so-called admin panel. It is a toolbar that appears at the top of the administration area. It is also accessible in the browser even outside of the administration area if you remain logged into the system. Admin panel allows you, for example, to quickly edit posts, interact with certain plugins (such as cache plugins), and much more. However, there may be situations where it is appropriate to hide this admin panel from all users except administrators. Let’s take a look at three ways, how to easily hide the admin panel for WordPress users. First, for those who do not have an administrator role, and then for everyone. One method will be individual, directly on the user, while the other two will be comprehensive, using a snippet.

Jak skrýt admin panel pro uživatele WordPressu

How to easily hide the admin panel for WordPress users

Hide the panel individually directly in the user settings

The first option to hide the admin panel is suitable for websites with a small number of users. You can do this individually in the settings of each individual user. This makes sense for websites with, for example, up to ten users. Editing several tens or hundreds of users is time-consuming and does not make sense.

If you go to the user management through the left menu and select “Users“, WordPress will display a list of users. Choose a user and click on “Edit“. Uncheck the option “Show toolbar when viewing the site” and save the new settings. At this point, you have disabled the display of the admin panel on the website for the specific user when they are logged in.

Hide the panel collectively from all users except the administrator

The second option is much more convenient. You can hide the admin panel collectively from all users, except for administrators. You can achieve this by using a short code inserted into the website. If you are unsure how to insert such codes into a website, please refer to this guide first (How to Insert Custom Codes into WordPress), as it is very straightforward.

Have you looked at the article and now know how to insert short codes into a website? Excellent, let’s take a look at the code that will disable the admin panel in WordPress for all users, except administrators.

				
					add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
}
}
				
			

Once you insert this PHP code into your website using the plugin and activate it, the code will ensure that the admin panel is not displayed to any users unless they have administrator rights.

Can I hide the admin panel completely for everyone, including administrators?

Yes, you can, and if you are using the WPCode plugin, it can be done very easily. In the second point above, I provided a link to the WPCode plugin for inserting snippets. However, this plugin also has a snippet database that you can use anytime and as you wish. In the left menu, select the “Code Snippets” option, and in the submenu, choose “Library“. Here, you can select the pre-made snippet “Disable The WP Admin Bar“. The plugin will activate this snippet, and the admin panel will be hidden completely from all users, including those with administrator rights.

Jak skrýt admin panel pro uživatele WordPressu
				
					/* Disable WordPress Admin Bar for all users */
add_filter( 'show_admin_bar', '__return_false' );
				
			

If you are using a different plugin for inserting snippets, here is the specific snippet that performs this action.

How to easily hide the admin panel for WordPress users

Conclusion

As you can see, hiding the panel is not a complicated matter at all. Furthermore, the WPCode plugin will come in handy for many other issues in the future that you may not necessarily need another plugin for. Many things can be solved using snippets. So, if you want to hide the admin panel, for anyone, try one of the methods and the problem will be resolved.

More content about WordPress

Whole category is here

The website is created with care for the included information. I strive to provide high-quality and useful content that helps or inspires others. If you are satisfied with my work and would like to support me, you can do so through simple options.

Byl pro Vás tento článek užitečný?

Klikni na počet hvězd pro hlasování.

Průměrné hodnocení. 0 / 5. Počet hlasování: 0

Zatím nehodnoceno! Buďte první

Jak užitečný vidíte tento článek.

Sledujte mě na sociálních médiích.

Je mi líto, že pro Vás nebyl článek užitečný.

Jak mohu vylepšit článek?

Řekněte mi, jak jej mohu zlepšit.

newsletter

Subscribe to the Newsletter

Stay informed! Join our newsletter subscription and be the first to receive the latest information directly to your email inbox. Follow updates, exclusive events, and inspiring content, all delivered straight to your email.

Odebírat
Upozornit na
guest
0 Komentáře/ů
Nejstarší
Nejnovější Nejvíce hlasováno
Vložené zpětné vazby.
Zobrazit všechny komentáře.

Pokud mi chcete napsat rychlou zprávu, využije, prosím, níže uvedený
kontaktní formulář. Děkuji.

Další Kontaktní údaje