Set fix domain in a canonical url

#497790
  • Resolved Michael Schnell
    Rank Math free

    I have a website with more than one domain.
    Each Website works under the domain name.

    But now I want to set on all domains a canonical with refer to Domain1/*.

    How can I do it?

    In the functions maybe?

    Best wishes
    Michael

Viewing 1 replies (of 1 total)
  • Nigel
    Rank Math business

    Hello,

    Thank you for contacting Rank Math for help with setting a single canonical for a multidomain website.

    You can customize the following function to set the canonical of your website:

    
    /**
     * Allow changing of the canonical URL.
     *
     * @param string $canonical The canonical URL.
     */
    add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
    	return $canonical;
    });
    

    Hope that helps. Please let us know if you have questions.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Set fix domain in a canonical url’ is closed to new replies.