WordPress uses the phrase “Howdy!” in various locations of the admin including the toolbar at the top where it reads “Howdy! {User}”. If you find this to be a little unprofessional (like I do) and want to change or remove it, you’ve come to the right place. I will show you how.

How to Remove “Howdy” in the WordPress Admin Bar

If you want to remove the phrase specifically from the admin toolbar only you can use the following code snippet:

// Remove Howdy in the WordPress admin toolbar.
function wpexplorer_remove_admin_bar_howdy( $wp_admin_bar ) {
	$my_account = $wp_admin_bar->get_node( 'my-account' );
	if ( isset( $my_account->title ) ) {
		$wp_admin_bar->add_node( [
			'id'    => 'my-account',
			'title' => str_replace( 'Howdy, ', '', $my_account->title ),
		] );
	}
}
add_filter( 'admin_bar_menu', 'wpexplorer_remove_admin_bar_howdy', PHP_INT_MAX );

Notice how I am using PHP_INT_MAX for the priority of the filter? This is to ensure the code always takes priority. You could use an integer instead, just make sure it’s large enough if you are using a WordPress multi-site installation.

Additionally, you can see we are using the add_node method which can be a bit confusing. If you look WP_Admin_Bar::add_node() there is a check so if the node already exists it will update it rather then adding it.

Last, you will notice I am using str_replace to search for and replace Howdy instead of defining a new value for the title parameter. The title also includes the username and avatar so if you were to override it completely those two things will be removed.

How to Change “Howdy” in the WordPress Admin Bar

If you want to modify the WordPress admin toolbar to say something different instead of just removing the word “Howdy”, you can use this code snippet:

// Change Howdy to Logged in as in the WordPress admin toolbar.
function wpexplorer_modify_admin_bar_howdy( $wp_admin_bar ) {
	$my_account = $wp_admin_bar->get_node( 'my-account' );
	if ( isset( $my_account->title ) ) {
		$wp_admin_bar->add_node( [
			'id'    => 'my-account',
			'title' => str_replace( 'Howdy, ', __( 'Logged in as,', 'text_domain' ), $my_account->title ),
		] );
	}
}
add_filter( 'admin_bar_menu', 'wpexplorer_modify_admin_bar_howdy', PHP_INT_MAX );

This snippet will specifically change “Howdy,” to “Logged in as,” but you can of course modify the string to say anything you want.

Removing the Word “Howdy!” Everywhere in WordPress

The phrase “Howdy!” is actually used in many places, including various welcome and confirmation messages. In my opinion it doesn’t sound very professional and I’m not sure why it’s used so heavily.

Trying to locate everywhere “Howdy!” is being used would be a huge pain. Luckily WordPress is localized so text can be modified via the core gettext filter.

Important: This method modifies the word Howdy! from the translated text, so if your site isn’t in English it may not work as expected.

The following snippet can be used to remove “Howdy” from all text:

// Removes "Howdy" from various WordPress strings.
function wpexplorer_remove_howdy_in_strings( $text ) {
	$text = str_ireplace( 'Howdy! ', '', $text );
	$text = str_ireplace( 'Howdy, ', '', $text );
	return $text;
}
add_filter( 'gettext', 'wpexplorer_remove_howdy_in_strings' );

This code will locate any text that contains “Howdy! ” or “Howdy, ” and replace that with nothing (aka remove it). Thus, removing “Howdy” from the admin bar as well as various notices and messages.

Now, you could modify the code above to replace “Howdy” with something else, but you will want to pass the second parameter to your function so you can make your adjustments based on the original text. Here is an example:

// Removes "Howdy" from specific WordPress strings.
function wpexplorer_remove_howdy_in_strings( $translated_text, $text ) {
	if ( 'Howdy, %s' === $text ) {
		$translated_text = str_ireplace( 'Howdy, ', '', $text );
	}
	return $translated_text;
}
add_filter( 'gettext', 'wpexplorer_remove_howdy_in_strings', 10, 2);

Conclusion

In this article I showed you how to remove or change Howdy in WordPress. Personally, I find it unprofessional and hopefully one day it will be removed from core. For the meantime, you will have to do it yourself. There are plugins out there you could use instead, but I find it silly to install a whole plugin for something you can do with a little bit of code.

Similar Posts