Change Admin Bar “Visit Site” URL

The admin bar is using the home_url() function which you can modify the result by using the “home_url” filter, this will change a lot of links on your admin area so looks like it’s not the best solution, anyway remember to use the is_admin() conditional tag or you will affect everything on the front end too.

https://github.com/WordPress/WordPress/blob/master/wp-includes/admin-bar.php#L357

The second option is to set the href directly:

    $node->href="https://www.google.com";