No results found. Try again with different words?

Search must be at least 3 characters.

How to Change Website Logo Destination URL

Sidebar Image

Did not find a solution? We are here to help you succeed.

Your website’s logo isn’t just an image; it’s an important branding tool. Sometimes, you might need to change where your logo takes your website visitors when they click on it.

Whether it’s due to site changes or partnerships, customizing your logo’s destination URL is a smart move.

This guide will walk you through how to change the destination URL for the website logo effortlessly.

What are the Steps to Change Website Logo Destination URL

By following the below-mentioned easy steps, you can effortlessly customize your logo’s URL and take full control of your website’s branding and functionality.

  • Log in to your website’s admin dashboard.
  • Locate and click on “Appearance” in the left-hand menu. Then, select Theme Editor.
  • Select the Astra Child theme from the drop-down and click on Select to choose it.
  • Navigate to the child theme’s functions.php, from the right-hand section by selecting functions.php.
  • Add your below-provided code at the bottom of the file and click on Update File at the bottom.

For new users with Astra theme version 3.0.0 or above, and using the Header Footer Builder, use the code below—

add_filter( 'astra_logo', 'custom_astra_logo_link' );

function custom_astra_logo_link( $html ) {
    // Replace the default logo link with your custom link
    $custom_url = 'https://google.com';
    $html = preg_replace( '/href="([^"]*)"/', 'href="' . esc_url( $custom_url ) . '"', $html );
    return $html;
}

Make sure you replace the test URL (http://google.com) with your destination URL in the above code.

You can follow the instructions provided in this document to insert the code into the functions.php file of your child theme.

Was this article helpful?
Sidebar Image

Did not find a solution? We are here to help you succeed.

Related Docs

Join 1,653,898+ Happy Site Owners Using Astra

Whether you are a beginner, small business owner, or professional web developer, Astra provides all the tools you need to easily build your beautiful WordPress website.

Scroll to Top