Replace "Howdy, Name" in the top-right of the admin bar with just the user's name.
add_action( 'admin_bar_menu', function ( WP_Admin_Bar $bar ): void {
$node = $bar->get_node( 'my-account' );
if ( ! $node ) {
return;
}
/* translators: %s: current user's display name. Must match WordPress's own string. */
$howdy = sprintf( __( 'Howdy, %s' ), '' );
$bar->add_node( [
'id' => 'my-account',
'title' => str_replace( $howdy, '', $node->title ),
] );
}, 9999 );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
“Howdy” is charming on a personal blog and out of place on a business or client site. This snippet removes it and leaves the name and avatar.
The admin bar’s account item has the id my-account. Late on admin_bar_menu, after WordPress has built it, the snippet gets the item, removes the “Howdy, ” text and saves it back with add_node(), which updates an existing item.
The greeting is looked up with WordPress’s own translation function, so it also works on sites in other languages, where “Howdy” is translated.
Reload any admin page. The top-right corner should show your name without “Howdy,”.