, ,

Remove Items In Admin Bar Menu That Added By Plugins / Themes

Usually to remove any default items on Admin Menu Bar we can do as below

function remove_items_wp_admin_bar(){
	global $wp_admin_bar;
	
	//$wp_admin_bar->remove_menu('tribe-events');
	$wp_admin_bar->remove_node('tribe-events');
	$wp_admin_bar->remove_node('comments');
	$wp_admin_bar->remove_node('new-content');
	$wp_admin_bar->remove_node('site-name');
	$wp_admin_bar->remove_node('wp-logo');
			
}

add_action('admin_bar_menu', 'remove_items_wp_admin_bar', 1000);

But this technique sometimes does not remove any items / links that added by plugins and themes. So you should call using wp_before_admin_bar_render action as below.

add_action('wp_before_admin_bar_render', 'remove_items_wp_admin_bar', 1000);