Family Best Time >> Electronics

What everyone needs to know about the WordPress Admin Bar

WordPress comes with an admin bar that displays useful shortcuts for logged in users. This gives you quick access to administration tasks, even when you're viewing the front-end of your website. In this article, we will explain what the WordPress admin bar is and how you can use it or customize it to suit your own needs.

What everyone needs to know about the WordPress Admin Bar

What is the WordPress admin bar?

The WordPress admin bar is a floating bar that is displayed to logged in users. Contains links to different administration screens, allowing registered users to quickly switch to the administration area when viewing the website.

What everyone needs to know about the WordPress Admin Bar

The admin bar is displayed for all users within the admin area. Individual users can hide the admin bar when viewing the website by editing their user profile.

What everyone needs to know about the WordPress Admin Bar

The items displayed in the WordPress admin bar change depending on the user's role and permissions. For example, users with the admin role see different items in the menu bar than users with the editor role, etc.

Show or hide elements in the WordPress admin bar

Just like everything else in WordPress, the admin bar is fully customizable through custom code or plugins. Some plugins already take advantage of this feature by adding their own menus in the admin bar.

What everyone needs to know about the WordPress Admin Bar

To take control of the admin bar, you will first need to install and activate the Adminimize plugin. For more details, check out our step-by-step guide on how to install a WordPress plugin.

After activation, go to Settings »Manage page and find the Admin Bar Back-End Options and Admin Bar Front-End Options tabs.

What everyone needs to know about the WordPress Admin Bar

Clicking on each of them will take you to the admin bar options, where you can select which items to display in the WordPress admin bar. You can also choose visible elements for each user role.

What everyone needs to know about the WordPress Admin Bar

Don't forget to click the 'Update Options' button to save your changes.

Adminimize is a powerful plugin and it allows you to change not only the admin bar but also any admin screen on your WordPress site. For more information, check out our guide on how to hide unnecessary WordPress admin elements with Adminimize

Add custom links to the WordPress admin bar

The purpose of the WordPress admin bar is to provide quick shortcuts to different admin screens. You can further customize it by adding your own custom links to the admin bar.

For this, you will need to add custom code to your WordPress files. If you haven't done so before, check out our guide on how to copy and paste code in WordPress.

You must first add this code to your theme's functions.php file or a site-specific plugin.

 // agregar un enlace a la función de la barra de herramientas de WP wpb_custom_toolbar_link ($ wp_admin_bar) $ args = array ('id' => 'wpbeginner', 'title' => 'Search WPBeginner', 'href' => 'https: // www.google.com:443/cse/publicurl?cx=014650714884974928014:oga60h37xim ',' meta '=> array (' class '=>' wpbeginner ',' title '=>' Search WPBeginner Tutorials ')); $ wp_admin_bar-> add_node ($ args); add_action ('admin_bar_menu', 'wpb_custom_toolbar_link', 999); 

In this code, we've added a link to Google that searches WPBeginner. You need to replace the id, title and href values ​​with your own.

What everyone needs to know about the WordPress Admin Bar

For more details, check out our guide on how to easily add custom links to your WordPress admin bar.

Disable admin bar for all users except admins

The admin bar is very useful for site administrators, editors and authors. However, it's not very useful if you're running a WordPress membership website or simply require users to log in for certain tasks.

In that case, you may want to disable the admin bar for all users except site administrators. You will need to add the following code to the functions.php file of your theme or a site-specific plugin.

 add_action ('after_setup_theme', 'wpb_remove_admin_bar'); función wpb_remove_admin_bar () if (! current_user_can ('administrador') &&! is_admin ()) show_admin_bar (false); 

For more details, see our article on how to disable the WordPress admin bar for all users except admins.

We hope this article has helped you learn more about the WordPress admin bar. You may also want to see our step-by-step WordPress security guide to keep your WordPress admin area safe and secure.

If you enjoyed this article, please subscribe to our WordPress YouTube Channel video tutorials. You can also find us on Twitter and Facebook.