Change ‘Howdy’ greeting in WordPress

by Mike King

Toy Story Woody

Woody from Toy Story (courtesy of google images)

Being born & raised in Texas, I’m quite welcome to an old-style country greeting myself. Needless to say, I prefer to give my clients a bit more personal greeting when they log in to their WordPress admins.

There are plenty of plugins for changing the howdy greeting in WordPress, but here is a quick & simple solution that you can add to your functions.php to change the greeting as well.

/**
* Custom Greeting
*/
function custom_howdy( $text ) {

    $greeting = 'Aloha';

    if ( is_admin() ) {
        $text = str_replace( 'Howdy', $greeting, $text );
    }

    return $text;
}

add_filter( 'gettext', 'custom_howdy' );

Just change the value of the $greeting variable to whatever you want and you should be good to go.

The Watercooler

  1. Istvan

    Use “is_user_logged_in()” instead of “is_admin()” if you want to replace it in th frontend aswell.

    Reply
  2. Jeff Jones

    // Change or remove the “Howdy, Username” Greeting on the Menu bar

    function replace_howdy( $wp_admin_bar ) {
    $my_account=$wp_admin_bar->get_node(‘my-account’);
    $newtitle = str_replace( ‘Howdy,’, ‘Hello, welcome back!’, $my_account->title );
    $wp_admin_bar->add_node( array(
    ‘id’ => ‘my-account’,
    ‘title’ => $newtitle,
    ) );
    }
    add_filter( ‘admin_bar_menu’, ‘replace_howdy’,25 );
    - See more at: http://www.handy-html.com/change-the-howdy-greeting-message-on-the-wordpress-user-menu-bar/#sthash.1N5GT1FT.dpuf

    Reply

Speak your Mind

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

In the words of Chaka Khan: Tell Me Something Good!




×