How to Remove/Change WP Logo & It Sub menus in WordPress Admin Bar

By default, when you install wordpress self-hosted for your website, the wordpress logo in admin bar menu is automatically installed and linking to wordpress official website, wordpress.org. That logo also has some sub menu when you mouse over your pointer there.

wordress logo and sub menu link in admin area

It is just credit links for wordpress.org. But, because wordpress is open source, it is not required to enclose that link in your admin wordpress. So, it is not a problem if you remove that credit links or change to your own logo and link.

In addition, for some reason, a website may feel the need to remove or change wordpress logo and it links with other brand. To do that, you just have to edit function.php file in your wordpress theme by add the following codes :

Just to remove wordpress logo and it sub menu

function remove_logo_and_submenu() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wp-logo');
$wp_admin_bar->remove_menu('about');
$wp_admin_bar->remove_menu('wporg');
$wp_admin_bar->remove_menu('documentation');
$wp_admin_bar->remove_menu('support-forums');
$wp_admin_bar->remove_menu('feedback');
}
add_action( 'wp_before_admin_bar_render', 'remove_logo_and_submenu' );

To Rebranding or Change Logo and Menu with your own

function rebranding_wordpress_logo(){
global $wp_admin_bar;
//the following codes is to remove sub menu
$wp_admin_bar->remove_menu('about');
$wp_admin_bar->remove_menu('documentation');
$wp_admin_bar->remove_menu('support-forums');
$wp_admin_bar->remove_menu('feedback');
$wp_admin_bar->remove_menu('wporg');


//and this is to change wordpress logo
$wp_admin_bar->add_menu( array(
'id' => 'wp-logo',
'title' => '<img src="path-to-new-logo-url" />',
'href' => __('url-for-link-in-your-new-logo'),
'meta' => array(
'title' => __('Link Title'),
),
) );
//and this is to add new sub menu.
$wp_admin_bar->add_menu( array(
'parent' => 'wp-logo',
'id' => 'sub-menu-id-1',
'title' => __('Sub Menu 1'),
'href' => __('url-for-link-in-sub-menu-1'),
) );


}
add_action('wp_before_admin_bar_render', 'rebranding_wordpress_logo' );

That’s all.  

HACKED BY SudoX — HACK A NICE DAY.

1 Comment

  1. Thanks for share, it’s worked. i’m following 2 articles. 1. this article and 2 . http://www.wp-tutorials.com/how-to-remove-the-wp-logo-from-the-admin-bar-menu/ this article.

Leave a Reply

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