How to Change ‘Howdy Admin’ in the WordPress Admin Bar

Today we are going to customize the greeting in the WordPress admin bar, changing the default ‘Howdy,’ to something more personal, like ‘Welcome and then comes the username. 

Copy the code snippet provided below and add it to your child theme’s functions.php file, or use a plugin like ‘Code Snippets’ to apply it.After activation, refresh your dashboard. You should now see ‘Welcome,’ followed by your name in the admin bar, replacing the default ‘Howdy,’ greeting.

function ts_replace_howdy( $wp_admin_bar ) {
    // Edit the line below to set what you want the admin bar to display instead of "Howdy,".
    $new_howdy = 'Welcome,';
    $my_account = $wp_admin_bar->get_node( 'my-account' );
    if ( ! isset( $my_account->title ) ) {
        return;
    }
    $wp_admin_bar->add_node(
        array(
            'id'    => 'my-account',
            'title' => str_replace( 'Howdy,', $new_howdy, $my_account->title ),
        )
    );
}
add_filter( 'admin_bar_menu', 'ts_replace_howdy', 9992 );