Redirect all page to an other website

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

    Hello,

    Thank you for contacting Rank Math for help with adding a sitewide filter to change the canonical tag of all pages on your website.

    You can use a filter to modify canonical in our documentation: https://rankmath.com/kb/filters-hooks-api-developer/#change-canonical-url. Please try the one below:

    
    /**
     * Allow changing of the canonical URL.
     *
     * @param string $canonical The canonical URL.
     */
    add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
    	$canonical = str_replace("la-rochelle-web.fr","ac-web.fr",$canonical);
    	return $canonical;
    });
    

    Please refer to the following guide for how to add the code to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    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 ‘Redirect all page to an other website’ is closed to new replies.