WordPress: Remove or Change “Howdy”

- Advertisement -

How to Remove or Change “Howdy” in WordPress

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:

- Advertisement -
// 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.

- Advertisement -

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:

- Advertisement -
// 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.

The post How to Remove or Change “Howdy” in WordPress appeared first on WPExplorer.

- Advertisement -

Related articles

Measuring Influencer Marketing Success & ROI: A Guide

How to Measure Influencer Marketing Success & Return on Investment

What’s the best way to measure your next influencer marketing campaign? Find out with this article.

Fixing Gutenberg Fonts in Classic WordPress Themes

If you are using a Classic WordPress theme it’s possible that the Gutenberg editor looks like sh*t because it’s using default tiny serif fonts that can be difficult to read and write with. This simple guide will show you how you can fix this by customizing the default Gutenberg typography! Method 1: Using Inline CSS […]

The post Fix Gutenberg Fonts in Classic WordPress Themes appeared first on WPExplorer.

Finding Micro Influencers for Your Brand

How to Find Micro Influencers For Your Brand

With a small audience, micro influencers can have a big impact on your marketing strategy. Here‘s how to find them.

Disable “Welcome to Block Editor” Popup in WordPress

If every time you open the WordPress Gutenberg Editor you see a “Welcome to the block editor” popup you have probably become annoyed like me. I don’t understand why WordPress displays this notice every time you edit a post in Gutenberg regardless of how many times you close it. There is a track ticket open […]

The post How to Disable the “Welcome to the block editor” Popup in WordPress appeared first on WPExplorer.

Disable Admin Email Verification in WordPress

Sometimes when you log into WordPress you will see a notice with the heading “Administration Email Verification”. This site admin verification screen was added back in WordPress 5.3 as an extra security measure to ensure that your website’s administrator email is accurate. This is what the screen looks like: According to WordPress; the email verification […]

The post How to Disable the Administration Email Verification Screen in WordPress appeared first on WPExplorer.