Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/remove node


This function removes an item from the Toolbar. Toolbar items are also called "nodes".

The Toolbar replaces the Admin Bar since WordPress Version 3.3.

note: This function is a method of the WP_Admin_Bar class and $wp_admin_bar global object, which may not exist except during the 'admin_bar_menu' or 'wp_before_admin_bar_render' hooks.


<?php $wp_admin_bar->remove_node$id ); ?>


(string) (required) The node ID of the Toolbar item you want to remove .
Default: None

Finding Toolbar Node ID's

The node ID's can be found in the HTML source code of any WordPress page with a Toolbar on it. Find the list items that have ID's that start with "wp-admin-bar-". For example, the list item ID for the WordPress Logo on the left in the Toolbar is "wp-admin-bar-wp-logo":

<li id="wp-admin-bar-wp-logo" class="menupop"> … </li>

Remove "wp-admin-bar-" from the list item ID to get the node ID. From this example the node ID is "wp-logo".

Note: It's also possible to see all node ID's with this example from get_nodes().


Remove the WordPress Logo from the Toolbar

Put this in your theme's functions.php file.

add_action( 'admin_bar_menu', 'remove_wp_logo', 999 );

function remove_wp_logo( $wp_admin_bar ) {
	$wp_admin_bar->remove_node( 'wp-logo' );

Change Log

Source File

remove_node() is located in wp-includes/class-wp-admin-bar.php.


Toolbar API

See also index of Function Reference and index of Template Tags.
This article is marked as in need of editing. You can help Codex by editing it.