How to change Howdy, [username] in WordPress admin bar - Brown Surfing

How to change Howdy, [username] in WordPress admin bar

Posted on: July 20th, 2022
By: Efrain Lemus

Here’s a great tutorial from WPBeginner:

https://www.wpbeginner.com/wp-tutorials/how-to-change-the-howdy-text-in-wordpress-3-3-admin-bar/

I personally like to avoid using plugins whenever possible so I used the code option from this article:

add_filter( 'admin_bar_menu', 'replace_wordpress_howdy', 25 );
function replace_wordpress_howdy( $wp_admin_bar ) {
$my_account = $wp_admin_bar->get_node('my-account');
$newtext = str_replace( 'Howdy,', 'Welcome,', $my_account->title );
$wp_admin_bar->add_node( array(
'id' => 'my-account',
'title' => $newtext,
) );
}

Have any questions or comments? Write them below!


Leave a Reply

Your email address will not be published.