1

In the admin toolbar, I want to remove the avatar from the 'logged in as...' dropdown.

2

You can try this :)

add_action( 'admin_bar_menu', 'remove_my_account', 999 );
function remove_my_account( $wp_admin_bar ) {
    $wp_admin_bar->remove_node( 'user-info' );
}

Screenshot: http://nimb.ws/w8OV6e

  • Thanks. It also removes the link to the profile page, which I prefer to retain. – glvr May 1 '18 at 9:23
  • You can hide that by below code :) add_action('admin_head', 'hide_avatar_admin_bar'); function hide_avatar_admin_bar() { echo '<style> #wp-admin-bar-user-info .avatar{display:none !important;} </style>'; } Screenshot: nimb.ws/4bwFuA – Quang May 1 '18 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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