WordPress calls it the Toolbar, although developers still search for “admin bar.” You can hide it for one person in their profile or enforce a frontend policy in code. The important part is to stop before editing a minified file under wp-includes: core updates overwrite that change, and CSS only conceals markup that WordPress still generated.
Quick choice
Only your own frontend view: clear Users → Profile → Show Toolbar when viewing site, then save the profile.
Every user on one site: add the
show_admin_barfilter through a small custom plugin or must-use plugin.Subscribers/customers only: use a capability-based filter and preserve each editor’s profile preference.
Remove one menu item, not the whole bar: use the
admin_bar_menuhook and theWP_Admin_BarAPI.Hide it inside `/wp-admin/`: core does not support disabling the dashboard Toolbar through this frontend filter; redesign the admin experience only with a justified, tested plugin.
What the Toolbar setting controls
The profile checkbox and show_admin_bar filter control whether the Toolbar is shown while viewing the site frontend as a logged-in user. They do not revoke dashboard capabilities, log a user out, hide admin URLs, or replace authorization. WordPress no longer lets users turn off the Toolbar on administration screens through the profile preference.
The Toolbar contains context-sensitive links such as edit, new content, comments, profile, updates, and plugin additions.
Logged-out visitors do not receive an authenticated Toolbar. If they see a bar-like element, inspect the theme/plugin/cache rather than this setting.
Hiding the Toolbar can remove a convenient edit path but does not change what the user is permitted to edit.
Full-page/CDN caching must vary or bypass authenticated sessions; otherwise logged-in markup can leak or appear inconsistent regardless of Toolbar policy.
Method 1: hide it for your account
Sign in to WordPress.
Open Users → Profile (or click your profile/name in the Toolbar).
Under personal options, clear Show Toolbar when viewing site.
Choose Update Profile and confirm the “User Updated” response.
Open the frontend in the same logged-in session and verify several page templates. The dashboard Toolbar should remain.
When the checkbox is the right answer
It is a personal preference, requires no deployment, and survives theme changes.
It does not force the choice on other users, so it is unsuitable for a product-wide customer experience policy.
Administrators can update another user’s profile only within their legitimate permissions and governance; do not silently rewrite user preferences without a documented requirement.
On multisite, user-option behavior and network/site context can differ; test the exact site and account.
Method 2: hide it for everyone on the frontend
<?php
/**
* Plugin Name: Site Toolbar Policy
* Description: Hides the WordPress Toolbar on frontend requests.
*/
add_filter( 'show_admin_bar', '__return_false' );A minimal must-use plugin for an explicit site-wide frontend policy.
Why this is the supported mechanism
show_admin_baris the documented WordPress filter for the frontend Toolbar; returningfalseprevents it from being shown.__return_falseis a WordPress helper callback, so no custom one-line function is required.A file in
wp-content/mu-pluginsloads automatically and cannot be toggled accidentally through the normal Plugins screen. Create the directory when absent.A regular custom plugin is easier to activate/deactivate and may be preferable when operators need UI rollback.
A child theme’s
functions.phpworks technically, but the policy disappears when the theme changes; presentation-independent rules belong in a plugin.
Method 3: hide it for non-editors
<?php
/**
* Plugin Name: Site Toolbar Policy
*/
add_filter(
'show_admin_bar',
static function ( bool $show ): bool {
if ( current_user_can( 'edit_posts' ) ) {
return $show;
}
return false;
}
);Capability checks are more durable than hard-coding role names.
What this policy preserves
Users who can edit posts retain WordPress’s original
$showdecision, including their personal Toolbar preference.Subscribers/customers without
edit_postsreceivefalseon frontend views.current_user_can()checks effective capability, including custom roles and filters, instead of comparing fragile role labels.Choose the capability that represents the real business rule (
edit_posts,edit_pages, or a custom capability);manage_optionsis usually much narrower.Do not use a capability check as proof of identity in unrelated security logic. WordPress authorization must still protect each action and REST/AJAX endpoint.
Method 4: hide it only on selected frontend pages
<?php
/**
* Plugin Name: Site Toolbar Policy
*/
add_action(
'wp',
static function (): void {
if ( is_singular( 'course' ) ) {
add_filter( 'show_admin_bar', '__return_false' );
}
}
);Register the filter after WordPress knows which singular template is being queried.
Conditional takeaways
The
wpaction runs after the main query is available, so conditional tags such asis_singular()can evaluate the current frontend request.courseis a placeholder custom post type; replace it with the registered post-type slug.The filter is added only for matching requests, leaving other frontend pages and the dashboard untouched.
Test archives, previews, password-protected content, REST requests, AJAX, block themes, and page-builder preview modes separately when relevant.
Remove one Toolbar node instead of the whole bar
<?php
/**
* Plugin Name: Site Toolbar Policy
*/
add_action(
'admin_bar_menu',
static function ( WP_Admin_Bar $toolbar ): void {
$toolbar->remove_node( 'wp-logo' );
},
100
);Keep useful editing controls while removing one unnecessary menu node.
Toolbar API takeaways
admin_bar_menureceives theWP_Admin_Barobject used to construct Toolbar nodes.remove_node()takes a node ID, not its visible label or CSS selector. Inspect registered nodes when targeting plugin-added items.Priority 100 runs after many default registrations so the target node is likely present; plugin ordering can still require adjustment.
Removing a shortcut does not disable its destination or capability. Protect the underlying admin action independently.
Deploy as a regular plugin
php -l wp-content/plugins/site-toolbar-policy/site-toolbar-policy.php
wp plugin activate site-toolbar-policy
wp plugin status site-toolbar-policyRisk level: caution. Review the command before running it.
Deployment takeaways
php -lchecks syntax but cannot prove hook timing, capabilities, multisite scope, or frontend behavior.WP-CLI must target the correct WordPress installation, URL/network context, and operating-system user. Use
--urlwhere multisite context requires it.Activation changes site behavior. Take a current backup, stage/test first, and keep filesystem or WP-CLI rollback access.
A must-use plugin is not activated with
wp plugin activate; place its main PHP file directly underwp-content/mu-pluginsand verifywp plugin list --status=must-use.
Verify behavior, not just code presence
Test logged out: no Toolbar and no authenticated page leakage.
Test a subscriber/customer: frontend hidden according to policy; dashboard/access capabilities unchanged.
Test an editor/administrator: expected frontend preference and dashboard Toolbar remain usable.
Test desktop/mobile, representative templates, custom post types, previews, page builders, and multisite sites.
View page source: when properly disabled, Toolbar markup/assets and the
admin-barbody class should follow core behavior rather than being merely invisible CSS.Purge only the relevant application/page/CDN caches and retest authenticated cache bypass/vary rules.
Disable/remove the custom plugin and confirm the original behavior returns without restoring core files.
Why CSS display:none is not a real fix
The Toolbar markup and assets can still be generated/downloaded, wasting work and exposing menu labels in source/assistive technology.
WordPress can still add frontend spacing/classes intended for the bar, leaving a blank gap or layout shift.
A later stylesheet with different specificity/order can make the bar reappear.
Editing the core minified CSS is overwritten by updates and affects maintenance/integrity checks.
CSS does not change authorization. A user can still visit permitted dashboard URLs directly.
If CSS is useful temporarily to confirm a layout collision, put it in a child theme/site CSS, document it as diagnosis, and remove it after fixing rendering policy.
Toolbar missing when it should be visible
Confirm Users → Profile → Show Toolbar when viewing site is enabled and saved for the current user.
Search custom plugins, MU plugins, theme functions, snippets, and vendor plugins for
show_admin_bar()or theshow_admin_barfilter.Verify the theme calls
wp_head()andwp_footer()in the appropriate templates; malformed themes can omit required assets/markup.Inspect the frontend HTML for
wpadminbar,admin-barbody class, and styles before blaming the browser.Check full-page/CDN caches for authenticated responses and test in a clean browser session.
Use a staging clone and Health Check/troubleshooting workflow to isolate plugin/theme conflicts without disrupting visitors.
Common implementation mistakes
Editing core CSS/PHP: updates overwrite it; restore clean core files and move the policy into a plugin.
Using role-name string comparisons: custom roles and capability changes break assumptions; check the capability that represents the action.
Returning false for all admin behavior: the documented filter targets the frontend Toolbar and cannot be treated as a supported dashboard-removal API.
Putting policy only in a parent theme: theme updates/switches remove or overwrite it.
Calling conditional tags too early: request context is incomplete; hook at a lifecycle point where the main query exists.
Treating hidden UI as security: enforce permissions with capabilities, nonces where applicable, server-side authorization, and least privilege.
Safe rollback
Regular plugin: deactivate it with the Plugins screen or
wp plugin deactivate site-toolbar-policy.MU plugin: rename/move the specific policy file through controlled filesystem access; do not delete the entire
mu-pluginsdirectory.Child theme: revert only the tracked commit/snippet after verifying no unrelated user edits overlap.
If a PHP fatal blocks wp-admin, use WP-CLI, hosting file manager, SSH/SFTP, or deployment rollback to disable the exact plugin.
After rollback, clear relevant caches and test frontend plus dashboard with each affected user class.
Related WordPress guides
Maintain content safely with bulk-deleting WordPress posts.
Build durable customizations with creating a WordPress child theme.
Debug conflicts using WordPress debug logging.
Primary references
WordPress documents the `show_admin_bar` filter as the recommended frontend Toolbar switch.
The `show_admin_bar()` function reference documents direct display status control and timing.
WordPress’s Toolbar documentation explains frontend profile behavior and the dashboard limitation.
The Your Profile documentation documents the Show Toolbar when viewing site preference.
The `WP_Admin_Bar` reference documents node-level customization.
Comments and corrections