-
hello sir,
I want to change the URL or link tag rel=canonical. I have large number of posts on my site. I want to change this from filter. I have tried with these filters but these are only change the value of meta og:url not link tag value please let me know how I can change this without editing one by one post Thanks
/**
* Allow changing of the canonical URL.
*
* @param string $canonical The canonical URL.
*/
add_filter( ‘rank_math/frontend/canonical’, function( $canonical ) {
return $canonical;
});/**
* Allows the output of the canonical URL as OpenGraph URL, consolidating likes and shares.
*
* @link https://developers.facebook.com/docs/reference/opengraph/object-type/article/
* @param $url Canonical URL
*/
add_filter( ‘rank_math/opengraph/url’, function( $url ) {
return $url;
});
You must be logged in to reply to this ticket.