# Remove Items From the Admin Bar

> Removes admin bar entries you never use, such as Comments, "+ New", Customize or Search.

- Type: PHP
- Runs: Run everywhere
- Category: [Admin](https://wpide.com/library/category/admin/)
- Tags: admin, admin-bar, cleanup
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/remove-admin-bar-items/

## Code

```php
// Node IDs to remove. Common ones: comments, new-content, customize, search, updates, edit, site-editor.
$wpide_admin_bar_remove = array( 'comments', 'new-content', 'customize', 'search' );

add_action( 'admin_bar_menu', function ( $wp_admin_bar ) use ( $wpide_admin_bar_remove ) {
    foreach ( $wpide_admin_bar_remove as $node_id ) {
        $wp_admin_bar->remove_node( $node_id );
    }
}, 999 );
```

## Notes

To find a node ID, inspect the admin bar item: its list element id is "wp-admin-bar-" followed by the node ID.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Remove Items From the Admin Bar" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
