Hi,
I would like to change my canonical url to point to the url with the trailing slash.
example>
my current canonical url points to the url withouth the trailing slash. https://site.com
i want to change to point to> https://site.com/
I have a ryte account and this is what they told me:
is there a way to change the canonical url, because i cannot find that option on the plugin.
Thank you.
Hello,
Thank you for contacting MyThemeShop today.
By default Rank Math uses Post permalink value for canonical url. You can add trailing slash in Permalink structure by Navigating to Dashboard >> Settings >> Permalinks:
If you only want to change canonical url without changing permalink structure then, please add below filter code in your theme's functions.php file:
add_filter( 'rank_math/frontend/canonical', function( $url ) {
return trailingslashit( $url