[OFFER ALERT!] This Halloween, Get Any Premium Theme for Just $19 [GET IT NOW]
Jump to content

[Rank Math SEO Plugin] Change Canonical URL.


buedvideos
 Share

Recommended Posts

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:

Quote

 

Best practise is usually to have the version with trailing slash be the canonical version, actually. Especially for the root directory it doesn't make much sense to have it the other way around, as Google always indexes the root with trailing slash. You can check out their webmaster guidelines for more information on that.
 
As long as you are consistent it shouldn't matter whether or not your canonical URLs have trailing slashes, though.
To resolve the issue that Ryte reports you only need to make sure that all your internal links point to canonical URLs. At the moment you have 102 links, as well as your sitemap(!), pointing to https://afrohouseking.com/(with trailing slash), even though the canonical on that page points to the URL without trailing slash.
 
Also please note that by the looks of it your homepage is actually the only page on your domain that points to the URL without trailing slash as canonical. All other canonical URLs seem to have the trailing slash: 

 

 

is there a way to change the canonical url, because i cannot find that option on the plugin.

Thank you.

Link to comment
Share on other sites

  • Support

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: 8fa5N5+

 

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 );
});

Hope that helps. If there is anything else, please let us know.

Thank you.


🏁Rank #1 on Google With our WordPress SEO Plugin.

Score a 💯on PageSpeed and Dominate Search Rankings.

✏ Editing theme files? Please create a child theme to make your changes update-proof.

Link to comment
Share on other sites

  • Support

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: 8fa5N5+

 

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 );
});

Hope that helps. If there is anything else, please let us know.

Thank you.


🏁Rank #1 on Google With our WordPress SEO Plugin.

Score a 💯on PageSpeed and Dominate Search Rankings.

✏ Editing theme files? Please create a child theme to make your changes update-proof.

Link to comment
Share on other sites

  • Support

Hello,

It was a pleasure helping you. We are glad you found our help useful. If you have any other questions in the future, do let us know. We are here to help you.

Could you please leave us a testimonial (if you haven't already done that) about your overall experience with the plugin and the support? This will help us serve you, our members, better. We appreciate your time and patience.
https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post

Thank you in anticipation.


🏁Rank #1 on Google With our WordPress SEO Plugin

Score a 💯on PageSpeed and Dominate Search Rankings.

✏ Editing theme files? Please create a child theme to make your changes update-proof.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...