How to Hide WordPress Toolbar

图片[1]-如何隐藏 WordPress 工具栏-光子波动网 | 专业WordPress修复服务,全球范围,快速响应

When logging into the WordPress dashboard, you will see a toolbar (admin bar) at the top that provides quick links and the ability to manage sections. However, this toolbar can seem redundant or even annoying when you want to view the user-friendliness of your website or page layout. In this article, we'll cover a few simple ways you can easily hide or disable the WordPress toolbar.

When to hide the toolbar

  1. Loss of administrator access: IfForgot Password, Security PluginLocking you out or plugin/theme issues that prevent access to the WordPress admin dashboard can be regained by hiding the toolbar.
  2. Broken WordPress: Encountering common WordPress incorrectWhen you do, you can help regain control by hiding the toolbar.
  3. security issue: If your website is hacked, you can protect it by hiding the toolbar.

Ways to hide the toolbar

1. Hiding toolbars through user settings

This is the easiest method for novice administrators:

  • Log in to your WordPress dashboard.
  • Open the "Users" section and select "personal profile".
  • Under the "Toolbars" option, uncheck "Show toolbars when viewing websites".
图片[2]-如何隐藏 WordPress 工具栏-光子波动网 | 专业WordPress修复服务,全球范围,快速响应

This way, the toolbar will no longer be displayed when you are logged in as that user.

2. Hiding the toolbar with plug-ins

WordPress has a number of plugins that can help you customize various aspects of your website, some of whichplug-in (software component)You can hide the toolbar:

  • Adminimize: This plugin allows you to customize which parts of the toolbar should be displayed based on user roles.
  • Hide Admin Bar Based on User Roles: You can choose to hide toolbars for specific user roles, such as author, editor, etc.
3. Using code snippets to hide toolbars

If you know your way around the code, you can find it in the theme's functions.php Add the following code snippet to the file:

图片[3]-如何隐藏 WordPress 工具栏-光子波动网 | 专业WordPress修复服务,全球范围,快速响应
  • Disable the toolbar completely:
add_filter('show_admin_bar', '__return_false');
  • Disable toolbars only for specific user roles (e.g. author):
add_filter('show_admin_bar', function($show) { if (current_user_can('author')) { return false; } return $show; });

caveat

  1. Avoid removing necessary features: Hiding the toolbar affects some shortcut operations, so make sure they don't interfere with your day-to-day administration.
  2. test code: Before adding the code to the functions.php Before you file, it is a good idea to test it in your development environment to make sure there are no errors.
图片[4]-如何隐藏 WordPress 工具栏-光子波动网 | 专业WordPress修复服务,全球范围,快速响应

summarize

The WordPress toolbar provides a lot of convenient shortcuts for website management, but in some cases, hiding it will allow you to better experience and manage your website. With user settings, plugins, or code snippets, you have the flexibility to customize theharbor (i.e. keep sth hidden)maybeprohibit the use of sth.Toolbar to improve the user experience and management efficiency of the website.


Contact Us
Can't read the article? Contact us for free answers! Free help for personal, small business sites!
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