WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Tutorials» How to Change the Howdy Text in WordPress 3.3 Admin Bar

How to Change the Howdy Text in WordPress 3.3 Admin Bar

Last updated on November 28th, 2011 by Editorial Staff
22 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Change the Howdy Text in WordPress 3.3 Admin Bar

Have you ever worked with a client where you are trying to customize the WordPress back-end experience for them? Maybe you added a custom dashboard widget, removed menu items, or even created custom write panels. Well Greg Kerstin (@graphicagenda) was working on a project where he wanted to modify the howdy text in the WordPress admin bar. Normally it says Howdy, Username. He was kind enough to submit a snippet to us in which he shows how to change the howdy text and replace it with Welcome.

Change Howdy to Welcome

All you have to do is paste the following code in your theme’s functions.php file, or create a site plugin.

add_action( 'admin_bar_menu', 'wp_admin_bar_my_custom_account_menu', 11 );

function wp_admin_bar_my_custom_account_menu( $wp_admin_bar ) {
$user_id = get_current_user_id();
$current_user = wp_get_current_user();
$profile_url = get_edit_profile_url( $user_id );

if ( 0 != $user_id ) {
/* Add the "My Account" menu */
$avatar = get_avatar( $user_id, 28 );
$howdy = sprintf( __('Welcome, %1$s'), $current_user->display_name );
$class = empty( $avatar ) ? '' : 'with-avatar';

$wp_admin_bar->add_menu( array(
'id' => 'my-account',
'parent' => 'top-secondary',
'title' => $howdy . $avatar,
'href' => $profile_url,
'meta' => array(
'class' => $class,
),
) );

}
}

And you are done.

22 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • How to Fix the Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

  • How to Properly Move Your Blog from WordPress.com to WordPress.org

  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

23 Comments

Leave a Reply
  1. Jen says:
    Aug 27, 2020 at 5:35 pm

    Thank you so much! Worked like a charm!

    Reply
    • WPBeginner Support says:
      Aug 28, 2020 at 10:46 am

      You’re welcome :)

      Reply
  2. Luvuyo Wati says:
    Apr 5, 2020 at 2:51 pm

    Worked, thank you.

    Reply
    • WPBeginner Support says:
      Apr 6, 2020 at 3:08 pm

      You’re welcome :)

      Reply
  3. Hadi El Jundi says:
    Dec 11, 2016 at 5:49 am

    Works like a charm! Many thanks, my friend!

    Reply
  4. Noah Pascua says:
    Dec 9, 2016 at 3:37 am

    Thank you. It works on mine.

    Reply
  5. simon says:
    Dec 22, 2015 at 9:25 am

    hello can anyone help me?
    I want to translate a string in wordpress theme
    //
    if($mt_o[‘mt_rewrite_doctor_name’]!=””) { $mt_cpt_doctors_name = $mt_o[‘mt_rewrite_doctor_name’]; } else { $mt_cpt_doctors_name = “Staff'”;}
    //
    i translated such :
    if($mt_o[‘mt_rewrite_doctor_name’]!=””) { $mt_cpt_doctors_name = $mt_o[‘mt_rewrite_doctor_name’]; } else { $mt_cpt_doctors_name = __(‘Staff’,’madza_translate’);}
    but it does not work!!!!
    can you guy help me ? plz plz

    Reply
  6. Ast says:
    Jul 25, 2015 at 7:18 am

    It doesnt work,,, after I use this code, wordpress (Version 4.2.2) admin panel cant load,, should remove this code..

    Reply
  7. David Labbe says:
    Feb 18, 2015 at 9:57 am

    There is a much easier way to do this by using the old menu node values:

    function np_replace_howdy($wp_admin_bar){

    //New text to replace Howdy
    $new_text = ‘Welcome’;

    //Call up the ‘my-account’ menu node for current values.
    $my_account = $wp_admin_bar->get_node(‘my-account’);

    //Replace the ‘Howdy’ with new text with string replace
    $new_title = str_replace(‘Howdy’, $new_text, $my_account->title);

    //Rebuild the menu using the old node values and the new title.
    $wp_admin_bar->add_menu(array(
    ‘id’ => $my_account->id,
    ‘parent’ => $my_account->parent,
    ‘title’ => $new_title,
    ‘href’ => $my_account->href,
    ‘group’ => $my_account->group,
    ‘meta’ => array(
    ‘class’ => $my_account->meta[‘class’],
    ‘title’ => $my_account->meta[‘title’],
    ),
    ));
    }

    add_action(‘admin_bar_menu’, ‘np_replace_howdy’, 999);

    See my gist:

    https://gist.github.com/Davidlab/8460a3cec27cb585d95c

    Reply
    • pushker says:
      Jul 19, 2016 at 7:51 am

      it is not woprking in my code . please suggest some easy code to remove howdy with hello

      Reply
  8. Gauranga says:
    Jun 5, 2014 at 2:22 am

    I tried but it didn’t work.. kept saying error and when tried to repair it, my WordPress admin panel couldn’t load any more :-( I had to switch back to my back up functions.php file (fortunately i had it). Perhaps i made a mistake but it would be nice to have something that is really copy and paste for neophytes like myself with clear instructions instead of expecting everyone to know something else that may be common sense for those who know codes. Gauranga.

    Reply
  9. Sanskar says:
    Mar 1, 2014 at 3:04 pm

    Can we make it change each time to say hello in different languages?

    Reply
    • WPBeginner Support says:
      Mar 2, 2014 at 1:52 pm

      Yes, you can. It may be a little complicated but do able. You will need to create an array in PHP with greetings in different languages. Then randomly pick a string from the array and use it with the rest of the code above.

      Reply
  10. NATHAN says:
    Jan 25, 2014 at 6:46 am

    Wow…! Thank you genius..,

    Reply
  11. Lee says:
    Dec 31, 2012 at 3:01 pm

    Perfect! Thank you.

    Reply
  12. iTechRevo says:
    Jan 7, 2012 at 9:56 pm

    Hey in the admin panel howdy can be edited but on the front end howdy is still there and cannot be changed so what should i do to edit it?

    Reply
  13. graphicagenda says:
    Jan 2, 2012 at 5:38 am

    @senlinonline: That is a great snippet! but it reverts back to the howdy for the frontend admin bar while logged in.

    Reply
  14. senlinonline says:
    Nov 29, 2011 at 7:57 am

    Changing “Howdy” can actually be done quite a bit simpler than the above code. Add this to your functions.php (or functionality.php or any other file): /** CHANGE HOWDY – http://wpmu.org/daily-tip-how-to-change-the-wordpress-howdy-message-to-a-custom-welcome/ **/add_filter(‘gettext’, ‘change_howdy’, 10, 3);function change_howdy($translated, $text, $domain) { if (!is_admin() || ‘default’ != $domain) return $translated; if (false !== strpos($translated, ‘Howdy’)) return str_replace(‘Howdy’, ‘Welcome back’, $translated); return $translated;}/** END CHANGE HOWDY **/

    Reply
  15. Sean 'Wordpress Guy' Vosler says:
    Nov 29, 2011 at 3:10 am

    I know, actually had a client ask me if it was made by a southern company because when I was signed it in said ‘howdy’, had a good laugh, but def something to do if your not positive on how a client might react

    Reply
  16. WPBeginner - WordPress for Beginners says:
    Nov 29, 2011 at 3:10 am

    Sean ‘WordPress Guy’ Vosler for the sake of customization? Not everyone thinks that Howdy is cool. Greg said he will be sending us a more detailed tutorial on how he added more links and such.

    Reply
  17. timgordons says:
    Nov 28, 2011 at 4:51 pm

    Cool Tutorial. Just love it. Thanks! for this

    Reply
  18. Maximiliano Noriega says:
    Nov 28, 2011 at 3:05 pm

    Wow, great tip

    Reply
  19. Sean 'Wordpress Guy' Vosler says:
    Nov 28, 2011 at 3:05 pm

    why would you want to change this??? :p

    Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
WPForms Logo
WPForms
Drag & Drop WordPress Form Builder Plugin. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2021 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2021)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2021)
    • SiteGround Reviews from 4464 Users & Our Experts (2021)
    • Bluehost Review from Real Users + Performance Stats (2021)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2021 – Step by Step Guide
Deals & Coupons (view all)
StackPath's logo
StackPath (MaxCDN) Coupon
Get StackPath CDN for just $10/month! It's the same service we use to make our site super fast.
Churnly Coupon
Get 30% OFF on Churnly WordPress automated churn-busting plugin.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
  • Growth Fund
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon
  • AIOSEO

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress Security by Sucuri.