# Replace the "Howdy" Greeting

> Changes the "Howdy, name" text in the top right of the admin bar to a greeting of your choice.

- Type: PHP
- Runs: Run everywhere
- Category: [Admin](https://wpide.com/library/category/admin/)
- Tags: admin-bar, greeting, white-label
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/replace-howdy-greeting/

## Code

```php
add_action( 'admin_bar_menu', function ( $admin_bar ) {
    $node = $admin_bar->get_node( 'my-account' );

    if ( ! $node || ! is_user_logged_in() ) {
        return;
    }

    $user     = wp_get_current_user();
    $greeting = 'Welcome back,';

    $admin_bar->add_node( array(
        'id'    => 'my-account',
        'title' => esc_html( $greeting ) . ' <span class="display-name">' . esc_html( $user->display_name ) . '</span>' . get_avatar( $user->ID, 26 ),
    ) );
}, 9999 );
```

## Notes

Edit $greeting.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Replace the "Howdy" Greeting" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
