How to Disable WordPress Admin Bar for All Users Except Administrators

Check Out More At: WP Beginner

WordPress: Best WordPress Plugins | WordPress Tutorials

How to Disable WordPress Admin Bar for All Users Except Administrators

Product Image Product Name / Primary Rating / Price Primary Button / Description
Best Wordpress Page Builder
  • Description:

    Elementor is an amazing website builder plugin for WordPress. Elementor makes it easy to create beautiful and high converting websites yourself without having to learn code.

Best WordPress Form Builder
  • Description:

    Gravity Forms is a WordPress plugin that creates powerful forms quickly and easily, with drag-and-drop fields, custom notifications and confirmations, and custom styling capability.

Best WordPress Theme
  • Description:

    Kadence Theme is a powerful, intuitive and flexible WordPress theme that offers an expansive set of features and customization options.

    It includes a robust page builder, beautiful design options, mobile-friendly responsiveness, powerful SEO tools and optimized performance for faster loading times.

    It's perfect for creating stunning websites without needing to write any code.

Best Wordpress Cloud Hosting
  • Description:

    Cloudways is a managed cloud hosting platform that simplifies cloud infrastructure deployment and management.

    It provides an intuitive dashboard, automated backups and optimized stack for speedy performance. It also provides 24x7 support with multiple server locations, enabling businesses to host their applications quickly and securely.

Best Budget WordPress Host
  • Description:

    Bluehost is an easy to use web hosting provider offering reliable, secure and affordable hosting solutions with 24/7 customer support.

Best Wordpress Page Builder
4.5
N/A
Description:

Elementor is an amazing website builder plugin for WordPress. Elementor makes it easy to create beautiful and high converting websites yourself without having to learn code.

Best WordPress Form Builder
3.5
N/A
Description:

Gravity Forms is a WordPress plugin that creates powerful forms quickly and easily, with drag-and-drop fields, custom notifications and confirmations, and custom styling capability.

Best WordPress Theme
3.5
N/A
Description:

Kadence Theme is a powerful, intuitive and flexible WordPress theme that offers an expansive set of features and customization options.

It includes a robust page builder, beautiful design options, mobile-friendly responsiveness, powerful SEO tools and optimized performance for faster loading times.

It's perfect for creating stunning websites without needing to write any code.

Best Wordpress Cloud Hosting
3.5
N/A
Description:

Cloudways is a managed cloud hosting platform that simplifies cloud infrastructure deployment and management.

It provides an intuitive dashboard, automated backups and optimized stack for speedy performance. It also provides 24x7 support with multiple server locations, enabling businesses to host their applications quickly and securely.

Best Budget WordPress Host
4.0
$3.95/Mo
Description:

Bluehost is an easy to use web hosting provider offering reliable, secure and affordable hosting solutions with 24/7 customer support.

Lasso Brag

First, you need to access your WordPress site’s files either through FTP or by using a file manager in your hosting control panel. Once you have accessed your files, you need to edit the functions.php file which is located in the “/wp-content/themes/your-theme-name/” directory.

You will now need to add the following code at the end of your functions.php file:

add_filter( ‘show_admin_bar’, ‘__return_false’ );

add_action( ‘admin_bar_menu’, ‘remove_admin_bar_links’, 999 );

function remove_admin_bar_links() {

global $wp_admin_bar;

$wp_admin_bar->remove_menu(‘about’);

$wp_admin_bar->remove_menu(‘wporg’);

$wp_admin_bar->remove_menu(‘documentation’);

$wp_admin_bar->remove_menu(‘support-forums’);

$wp_admin_bar->remove_menu(‘feedback’);

$wp_admin_bar->remove_menu(‘view-site’);

}

Save the changes you have made to the functions.php file and upload it back to your WordPress site. Once you have done that, the admin bar will be disabled for all users except for administrators.

One of the first things you may want to do when you start using WordPress is to disable the admin bar. The admin bar is the black bar that appears at the top of your screen when you are logged in to your WordPress site. This bar gives you quick access to your WordPress Dashboard, as well as links to add new content, manage comments, and view your profile.

If you are not an administrator on your WordPress site, you may not want to have the admin bar visible. The good news is that it is easy to disable the admin bar for all users except administrators.

To do this, you will need to edit your theme’s functions.php file. You can access this file by going to Appearance > Editor in your WordPress Dashboard.

On the right-hand side, you will see a list of files in your theme. Find the file called functions.php and click on it to open it in the editor.

At the bottom of the file, you will need to add the following code:

add_filter( ‘show_admin_bar’, ‘__return_false’ );

Save your changes and close the file.

The next time you visit your WordPress site, you will notice that the admin bar is no longer visible. However, if you are logged in as an administrator, you will still see the admin bar.

If you ever want to re-enable the admin bar, simply remove the code you added to your functions.php file.

Similar Posts