Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I never use the WP menu (the logo and its child items) except when I click it accidentally. And it is wasting my time when I navigate per keyboard. Plus, the support page is not our site.

How can I remove it?

Screenshot of the menu:

enter image description here

share|improve this question

3 Answers 3

up vote 5 down vote accepted

This menu is added in WP_Admin_Bar::add_menus() with an action:

add_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 );

To remove it take the same action – just one step later. The following code works as a mu plugin or as a regular plugin:

<?php # -*- coding: utf-8 -*-
/**
 * Plugin Name: Remove WP Menu From Tool Bar
 */
if ( ! function_exists( 't5_remove_wp_menu' ) )
{
    // The action is added with a priority of 10, we take one step later.
    add_action( 'init', 't5_remove_wp_menu', 11 );

    /**
     * Remove the WP menu action.
     */
    function t5_remove_wp_menu()
    {
        is_admin_bar_showing() &&
            remove_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 );
    }
}

It has a GitHub address too.

After the installation the sites menu is the first one:

enter image description here

See also this great answer for other menus and more details about the inner workings of the admin bar/tool bar.

Update

The old code doesn’t work anymore, this one does:

add_action( 'add_admin_bar_menus', function() {
    remove_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu' );
});
share|improve this answer

also possible, only as hint:

add_action( 'admin_bar_menu',    'fb_admin_bar_menu', 25 );

/**
 * Removes the "W" logo from the admin menu
 *
 * @access public
 */
function fb_admin_bar_menu( $admin_bar ) {

    $admin_bar->remove_node( 'wp-logo' );
}
share|improve this answer
    
+1 for OOP alternative. But don’t we waste some microseconds when we let WordPress create the menu first and delete it later? :) –  toscho Jun 18 '12 at 18:18
1  
right; but on your solution is also an lost of seconds ;) the init was always fired, also if you not logged in and the admin bar is inactive; maybe we can check for is admin bar active and then we remove the menu item. maybe via if ( ! is_admin_bar_showing() ) return; –  bueltge Jun 19 '12 at 6:33
    
Good hint, I can at least save the _wp_filter_build_unique_id() look-up. –  toscho Jun 19 '12 at 7:29
    
yup, fine and now it is faster. –  bueltge Jun 19 '12 at 8:57

@PieterGoosen & @kaiser

https://wordpress.org/plugins/osd-remove-all-wp-creds/

That is the link to the plugin. It removes quite a few WP plugs like:

Title Bar in Admin Section
Favicon in Admin Section
Favicon on Login Page
Tagline
Admin Menu Bar
Various widgets are removed
Various Meta boxes
Welcome Panel
Admin Footer
Login Screen Logo
Login Screen Title

The plugin code is commented pretty well, so it is easy to deduce what I have done and repeat it on your own in your functions.php file or whatever you choose.

Here are a few blocks of code from the plugin to answer the original question plus a bonus:

//This adds an action to the admin bar menu that removes the WP Logo simple and sweet
function osd_remove_wp_from_theme($wp_admin_bar) {
    $wp_admin_bar->remove_node('wp-logo');
}
add_action('admin_bar_menu', 'osd_remove_wp_from_theme', 999);

bonus:

//filter to remove wp from title(the text displayed in the browser bar) in admin section
function osd_remove_wp_from_admin_title() {
    return get_bloginfo('name') . " > Administration";
}
add_filter('admin_title', 'osd_remove_wp_from_admin_title');
share|improve this answer
1  
Please do not create multiple accounts and post under multiple accounts :-) –  Pieter Goosen Sep 30 at 19:29
    

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.