-
Hello,
I would like that all default canonical URLs (products, pages…) to remove the slash “/” at the end.
I’ve got the opposite issue to this post : https://support.rankmath.com/ticket/make-default-canonical-include-trailing-slash/#post-99069
So I guess the code should be quite similar.But first, I would have like to solve that without code.
Why default canonical URLs don’t change by modifying permalink settings ?On Rank Math website it’s writen : “Even if you don’t set a canonical URL inside Rank Math, Rank Math will set the * post’s current URL* as the canonical URL of the page. Depending on your permalink settings, you might want to set a canonical URL yourself or change your permalink settings so that the default canonical URL is the one that works for you.”
Is my unique chance to get it right was to have the good permalink setting before installing Rank Math ?
If it’s not possible to solve this with permalink settings, I would need a code that will check if a canonical is already defined in Rank Math and if it is, it uses it. And if it is not, it takes the current canonical and if it has a slash at the end, it removes it.
The ticket ‘Make Default Canonical remove trailing slash’ is closed to new replies.