How to Hide WordPress Admin Bar for Different Users

WordPress admin bar is a useful tool, but some web developers hide it to preserve the website design, some may also disable it to prevent other users from accessing the WordPress dashboard, here to know what are some ways to hide WordPress admin bar?

Image [1] - How to hide WordPress admin bar for different users - Photon Flux | Professional WordPress Repair Service, Worldwide, Fast Response

How do I hide the admin bar for all users?

  • Using plug-ins

Hide Admin BarThe plugin removes all admin bars. Follow the steps below to activate:

  1. Open the WordPress admin page. In the sidebar, find "plug-in (software component)"→"Add New Plugin"
  2. Enter the name of the plug-inHide Admin Barand then press Enter.
  3. click (using a mouse or other pointing device)"Installation". Once the installation is complete, select"Activate."The
Image [2] - How to hide WordPress admin bar for different users - Photon Fluctuation | Professional WordPress Repair Service, Worldwide, Fast Response

From "In the installed plug-ins"FindHide Admin BarClick on "set up"You will then have the option to remove the admin bar for all users

Image [3] - How to hide WordPress admin bar for different users - Photon Fluctuation | Professional WordPress Repair Service, Worldwide, Fast Response

Auto Hide Admin BarThe plugin automatically hides the admin bar so that the WordPress toolbar disappears - and reappears when the mouse pointer is hovered over the top of the browser window, install and activate to use it.

Image [4] - How to hide WordPress admin bar for different users - Photon Fluctuation | Professional WordPress Repair Service, Global Reach, Fast Response
  • Usage Code

Manually remove the admin bar by editing the site code. You can do this in a number of ways - by editing the WordPress theme file or adding theCustom CSS CodeThe

Below is the website theme by editing the .php fileto hide the toolbar steps:

1. Login to the WordPress admin page.

2. From WordPress Menuin, go to exterior condition → Theme File EditorThe

Image [5] - How to hide WordPress admin bar for different users - Photonflux.com | Professional WordPress Repair Service, Worldwide, Fast Response

3. In the right sidebar findTopic Papersand then clickfunctions.phpThe

Image [6] - How to hide WordPress admin bar for different users - Photon Fluctuation | Professional WordPress Repair Service, Worldwide, Fast Response

4. Scroll the mouse toend of pageand paste the following code snippet:

add_filter('show_admin_bar', '__return_false');

caveat

  • modifications functions.php When doing so, it's best to do it through a child theme so that your changes aren't lost when the theme is updated.
  • Make sure you back up your site before modifying the code in case something goes wrong.

5. ClickUpdated documentsSave after.

How to hide the admin bar for a specific user

If you don't want to hide the Admin Toolbar from everyone, disable it for specific users.

  • Use WordPress Admin Dashboard to Hide User-Specific Admin Bars

1. Login to WordPress dashboard and navigate to the sidebar"Users"→"All users".

Image [7] - How to hide WordPress admin bar for different users - Photon Fluctuation Network | Professional WordPress Repair Service, Worldwide, Fast Response

2. Locate the desired user. Hover your mouse over theUser profilesand then click below its nameeditorialThe

Image [8] - How to hide WordPress admin bar for different users - Photonflux.com | Professional WordPress Repair Service, Worldwide, Fast Response

3. In "personal option"Under the section, find "toolbar (in computer software)"option, then uncheck the "Show toolbar when viewing website"Box.

Image [9] - How to Hide WordPress Admin Bar for Different Users - Photon Flux | Professional WordPress Repair Service, Worldwide, Fast Response

4. Scroll to the bottom of the page and clickUpdating Personal InformationPerform confirmation.

How to hide specific userscharacterManagement columns of the

  • Use plug-ins to hide the admin bar for specific user roles

Some WordPress plugins allow you to hide the toolbar for certain user roles when you assign users to the same role:

1. In the WordPress sidebar"Users"→"All users".

2. Find the user and select"Edit."The

3. In"Name."Under the section, assign from the drop-down menu thecharacterThe

Image [10] - How to hide WordPress admin bar for different users - Photon Fluctuation Network | Professional WordPress Repair Service, Worldwide, Fast Response

4. ClickUpdating Personal InformationAcknowledgment.

  • Use code to hide the admin bar for specific user roles

By adding the following to the WordPress site's functions.php file to add a code snippet to disable the admin bar for a specific role. You will need to use different codes depending on the role and purpose.

For example, to hide the admin bar for all users except those with administrative privileges:

1. On the WordPress sidebar → exterior condition → Theme file editor.

2. Go to"Theme paper"sidebar, and then click"functions.php".

3. Scroll to the bottom of the screen and paste the following code:

function hide_admin_bar_from_non_admins(){
    if (!current_user_can('administrator')) {
        add_filter('show_admin_bar', '__return_false');
    }
}
add_action('after_setup_theme', 'hide_admin_bar_from_non_admins'); }

4. ClickUpdated documentsSave after.

reach a verdict

Ways to hide the WordPress admin bar for all or specific users include:

  • utilization WordPress Admin Dashboardcompiler
  • Use plug-ins such asHide Admin BarmaybeAuto Hide Admin Bar
  • Internet censorshipThe functions.php of theAdd Code

Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
Customer Service
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: info@361sale.com
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
Author: xiesong
THE END
If you like it, support it.
kudos0 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments