Wrong Canonical url link
-
20-04-2021 - |
题
I have a weird problem.
I have a page that changed URL (because it's parent changed name).
Example Link https:www.mysite.com/my-services/service-1
is now: https:www.mysite.com/services/service-1
the canonical url however is still the original one: https:www.mysite.com/my-services/service-1
which is wrong. (it should be the new link)
This is what I tried:
I had the redirection plugin to handle the redirect, but have switched that one iff > does not solve the problem
I have switched of Yoast > doesn't help
I switched on Yoast again - and explicitely changed the canonical link in the Yoast SEO section of th page > that solves it.
However I don't want to manually have to change a canonical like this. Is there a better solution? Am I missing something? Can I regenerate canonical tags in batch? So many questions - is there someone with an answer?
Thanks a lot in advance, Ingrid
解决方案
You need to reset your indexables. There are a couple of ways to do this - you can use a WP-CLI command (wp yoast index
), or you can use the Yoast Test Helper plugin.
If you install the Yoast Test Helper Plugin, you can go to Tools > Yoast Test. In the "Yoast SEO" box with a bunch of buttons, use the "Reset Indexables tables & migrations" button to flush them. You can then uninstall the plugin, remove your manually-entered canonical URL, and the default (autogenerated) canonical URL will be fixed.
Theoretically, anytime you make a change such as changing a parent page URL, that should trigger Yoast to automatically update its indexables. So it may be worth opening a GitHub issue so they're aware this didn't happen as intended.