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

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!




×