-
Hello!
RankMath really is a great plugin! Unfortunately, I’m having issues with canonical urls: When I create a new post, its url only shows up in the posts sitemap if I don’t give it a canonical url. For example, I have https://www.mydomain.com/blog/this-is-a-post/ as the automatically generated URL of my post. As this post is not only assigned to the category “blog” but also to the blog sub-category “subcategory”, I can also reach my post at https://www.mydomain.com/blog/subcategory/this-is-a-post/ – and this is what I want to set as my canonical url. But as soon as I do this, the post disappears from the sitemap. Before adding the canonical url, https://www.mydomain.com/blog/this-is-a-post/ is listed in the sitemap. After adding the canonical url it disappears and https://www.mydomain.com/blog/subcategory/this-is-a-post/ does NOT show up either. Posts that I created prior to using RankMath (before migration from Yoast) are listed in the sitemap, however.
I use a plugin to create hreflang tags (https://wordpress.org/plugins/hreflang-tags-by-dcgws/) and I understand that other language versions of posts are not listed in the sitemap intentionally. And this is not the issue, but the issue is that also the main language version of the post doesn’t show up, and it doesn’t make a difference whether the hreflang tag plugin is active or deactivated. It just depends on the canonical url being present on the post’s “Advanced” RankMath tab. Also, when removing the canoncial url from a post, it doesn’t get deleted the first time after updating. It needs to be removed and updated a second time to be gone.
To make sure it isn’t a caching issue, I have also excluded caching in the .htaccess file and W3 Total Cache as described here (https://rankmath.com/kb/exclude-sitemaps-from-caching/) and I tried flushing the cache as described here https://i.rankmath.com/pipRDp to make sure caching isn’t the issue. Also, I have set my CDN to “editing mode” in my web hosting panel, so this shouldn’t be interfering either.
Also, I tried deactivating a plugin called “WP Last Modiefied Info” as it sometimes generates a php warning when accessing the sitemap, but this doesn’t solve the problem either.
I’ll be very happy if you have a solution for this 🙂 Thank you!
The ticket ‘Canonical URL not showing in sitemap’ is closed to new replies.