Admin & Dashboard PHP Beginner

Remove “Howdy” From the Admin Bar

Replace "Howdy, Name" in the top-right of the admin bar with just the user's name.

Tested on WordPress 7.1 PHP 8.3 No plugin needed Updated
functions.php 12 lines
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 );

Where to add this

Recommended A code snippets plugin Survives theme changes and is easy to switch off.
Child theme At the end of your child theme's functions.php file.
Must-use plugin As a .php file in wp-content/mu-plugins, starting with <?php.

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.

How it works

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.

Things to watch

  • Only the visible label changes. The account menu, profile link and log out link work exactly as before.

How to test it

Reload any admin page. The top-right corner should show your name without “Howdy,”.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only