Facebook redirects to canonical url

#552275
Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    In order to resolve this issue, you can add the following filter to your site. This should add the self-referencing URL to your og:url property for all URLs on your website:

    add_filter( 'rank_math/opengraph/facebook/og_url', function( $url ) {
    	
    	$url = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    	return $url;
    });
    

    Here’s how you can add filters/hooks to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Let us know how it goes.

    Thank you.

    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 ‘Facebook redirects to canonical url’ is closed to new replies.