• Skip to main content
  • Skip to primary sidebar

Purely Supplemental Hub

Just The Tech, News, and Info We Deem To Post

  • WordPress
  • Marketing
  • Business
  • Computing
  • Security
  • Publicity
  • Resources
  • WHATEVS

Add or Remove Links From the WordPress Admin Bar

Use This Snippet to Add Links to Admin Toolbar

Add the following code to your WordPress theme’s function.php file, or a functionality plugin. Modify the example for your link.

  • diww where diww is the ID of your menu item.
  • my-blogs where my-blogs is the parent ID of your menu item.
  • Title of the link you want to add where Title of the link you want to add is the title you want to use for your menu item.
  • http://mysitesurl.com/wp-admin.php where http://mysitesurl.com/wp-admin.php is the admin url of your menu item.
/** Use This Snippet to Add Links to Admin Toolbar */

function my_admin_bar_link() {
	global $wp_admin_bar;
	if ( !is_super_admin() || !is_admin_bar_showing() )
		return;
	$wp_admin_bar->add_menu( array(
	'id' => 'diww',
	'parent' => 'my-blogs',
	'title' => __( 'Title of the link you want to add'),
	'href' => admin_url( 'http://mysitesurl.com/wp-admin.php' )
	) );
}
add_action('admin_bar_menu', 'my_admin_bar_link');

Use This Snippet to Remove Links to Admin Toolbar

Add the following code to your WordPress theme’s function.php file, or a functionality plugin.

  • my-blogs where my-blogs is the ID of the menu item you want to remove
  • my-account-with-avatar where my-account-with-avatar is the ID of the menu item you want to remove
/** Use This Snippet to Remove Links to Admin Toolbar */

function remove_admin_bar_links() {
	global $wp_admin_bar;
	$wp_admin_bar->remove_menu('my-blogs');
	$wp_admin_bar->remove_menu('my-account-with-avatar');
}
add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );

Filed Under: WordPress Functionality Tagged With: Admin Menu, Code

Reader Interactions

Share Your Two Cents Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

© Copyright Jack Alltrade & Associates 2026 · Purely Supplemental™ is a trademark of Jack Alltrade & Associates