Ankit Sudhera Portfolio Website

Programming is my Passion
Provide Training is my skill
Quality and Commitment is my Life's Goal
Quality and Commitment is my Life's Goal
Programming is my Passion
Provide Training is my skill
Quality and Commitment is my Life's Goal
Quality and Commitment is my Life's Goal
Programming and Support is my Quality
Programming and Support is my Quality
Programming and Support is my Quality

Forum

AI Assistant
how to hide ‘Howdy’...
 
Notifications
Clear all

how to hide ‘Howdy’ with WP 6.6.1 anymore

1 Posts
1 Users
0 Reactions
1,220 Views
(@ankitbnl406)
Member Admin
Joined: 4 years ago
Posts: 13
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
  [#11]

Please see the below 2 scripts to remove the howdy in Wordpress, you can use any 1:

Solution 1:

add_filter( 'admin_bar_menu', 'replace_wordpress_howdy', PHP_INT_MAX - 100);
function replace_wordpress_howdy( $wp_admin_bar ) {
	$my_account = $wp_admin_bar->get_node('my-account');
	$wp_admin_bar->add_node( array(
	'id' => 'my-account',
	'title' => substr($my_account->title, strpos($my_account->title, '<span class="display-name">')),
	));
}

Solution 2:

function pac_da_custom_admin_bar_user_name() {
    global $wp_admin_bar;
    // Define the ID of the node representing the "My Account" section in the admin bar.
    $node_id = 'my-account';
    // Check if the specified node exists in the admin bar.
    if ($wp_admin_bar->get_node($node_id)) {
        // Get the current title of the "My Account" section.
        $current_title = $wp_admin_bar->get_node($node_id)->title;
        // Split the current title into an array based on the comma and space separator.
        $newTitle = explode(", ", $current_title);
        // Update the "My Account" section title with the second part of the split title if available, 
        // otherwise keep the current title.
        $wp_admin_bar->add_node(array(
            'id' => $node_id,
            'title' => isset($newTitle) && isset($newTitle[1]) ? $newTitle[1] : $current_title,
        ));
    }
}
// Hook the custom admin bar user name function to run before the admin bar is rendered.
add_action('wp_before_admin_bar_render', 'pac_da_custom_admin_bar_user_name');


   
Quote