Title: show_admin_bar
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘show_admin_bar’, bool $show_admin_bar )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#wp--skip-link--target)

Filters whether to show the admin bar.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#description)󠁿

Returning false to this hook is the recommended way to hide the admin bar.
The user’s
display preference is used for logged in users.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#parameters)󠁿

 `$show_admin_bar`bool

Whether the admin bar should be shown. Default false.

## 󠀁[More Information](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#more-information)󠁿

The show_admin_bar filter toggles the display status of the [Toolbar](https://wordpress.org/support/article/administration-screens/#toolbar-keeping-it-all-together)
for the front side of your website (you cannot turn off the toolbar on the WordPress
dashboard anymore).

This filter is part of the function [is_admin_bar_showing()](https://developer.wordpress.org/reference/functions/is_admin_bar_showing/).

Note: The Admin Bar is replaced with the Toolbar since WordPress [Version 3.3](https://wordpress.org/support/wordpress-version/version-3-3/).

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#source)󠁿

    ```php
    $show_admin_bar = apply_filters( 'show_admin_bar', $show_admin_bar );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/admin-bar.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/admin-bar.php#L1445)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/admin-bar.php#L1445-L1445)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#related)󠁿

| Used by | Description | 
| [is_admin_bar_showing()](https://developer.wordpress.org/reference/functions/is_admin_bar_showing/)`wp-includes/admin-bar.php` |

Determines whether the admin bar should be showing.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/show_admin_bar/?output_format=md#comment-content-4575)
 2.    [Steven Lin](https://profiles.wordpress.org/stevenlinx/)  [  6 years ago  ](https://developer.wordpress.org/reference/hooks/show_admin_bar/#comment-4575)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fshow_admin_bar%2F%23comment-4575)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fshow_admin_bar%2F%23comment-4575)
 4.  Examples migrated from Codex.
 5.  Note: The examples below should be called immediately upon plugin load or placed
     in theme’s `functions.php` file.
 6.  This code would turn the display status of the Toolbar to off.
 7.      ```php
         add_filter( 'show_admin_bar', '__return_false' );
         ```
     
 8.  Alternatively, you could write it into a full fledged function.
 9.      ```php
         add_filter( 'show_admin_bar' , 'my_function_admin_bar');
         function my_function_admin_bar() {
         	return false;
         }
         ```
     
 10. This would hide the Toolbar for all users except Administrators.
 11.     ```php
         add_filter( 'show_admin_bar' , 'my_function_admin_bar');
         function my_function_admin_bar($show_admin_bar) {
         	return ( current_user_can( 'administrator' ) ) ? $show_admin_bar : false;
         }
         ```
     
 12.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fshow_admin_bar%2F%3Freplytocom%3D4575%23feedback-editor-4575)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fshow_admin_bar%2F)
before being able to contribute a note or feedback.