You already know that I love the Astra theme, and I like it for many reasons, such as customization, clear interface and loading speed.
Now, like any theme, it doesn’t allow you to change everything, no matter how many customization options it offers. But despite this, it has a very extensive documentation that allows you to go even further than the customizations included by default in the theme.
One of the needs that may arise in a project, and that I myself needed recently for a client’s website, is to change the destination URL of the site logo, which by default will link to the domain of the website, as with all themes, it is not unique to Astra.
And is that Astra allows you to customize lots of things in all parts of your website, also in the site logo, but among these settings, there isn’t the one to change the destination URL. Don’t look for it, it’s not there.

But it’s easy really to do, you just have to add some code at the end of the functions.php file of your Astra child theme. Just keep in mind which version of Astra you have installed because the code is different.
Here you have both, use the right one for your version of Astra.
If you are using versions prior to Astra 3.0.0:
add_action('astra_masthead', 'astra_logo_change_url');
function astra_logo_change_url(){
remove_action( 'astra_masthead_content', 'astra_site_branding_markup', 8 );
add_filter( 'home_url', 'astra_logo_custom_url' );
add_action( 'astra_masthead_content', 'astra_site_branding_markup', 8 );
}
function astra_logo_custom_url( $url ) {
return 'https://new_url_.com';
}
add_action('astra_masthead_content','astra_remove_logo_custom_url',9);
function astra_remove_logo_custom_url(){
remove_filter( 'home_url', 'astra_logo_custom_url' );
}
Code language: PHP (php)
If you are using Astra version 3.0.0 or later:
add_action('astra_masthead', 'astra_logo_change_url');
add_action('astra_mobile_header_bar_top', 'astra_logo_change_url');
function astra_logo_change_url(){
remove_action( 'astra_masthead_content', 'astra_site_branding_markup', 8 );
add_filter( 'home_url', 'astra_logo_custom_url' );
add_action( 'astra_masthead_content', 'astra_site_branding_markup', 8 );
}
function astra_logo_custom_url( $url ) {
return 'https://new_url.com';
}
add_filter('astra_logo','astra_remove_logo_custom_url');
function astra_remove_logo_custom_url( $html ){
remove_filter( 'home_url', 'astra_logo_custom_url' );
return $html;
}
Code language: PHP (php)
The only thing you have to change in the code will be the destination URL, replacing the example URL(https://new_url.com) with the one you want.