Home page canonical loop issues – Google not indexing
-
Perhaps this question should simply be: “How do I specify the canonical URL for the home page?” However, I’ll detail the full issue I have anyway:
The SEO Framework is one of my favorite plugins. However, I’m troubleshooting an issue which has caused one of my site’s rankings to drop off the face of the earth. My fault for leaving it and not checking it earlier.
It seems the home page sends the crawler in a loop and is not being indexed.
I previously set permalinks to custom structure: domain.com/%postname% in order to remove trailing slashes and have clean URLs. This works fine. Any URL entered with a slash gets redirected to the non-slash version.
However, in the home page SEO Framework code, the canonical appears as domain.com/. That is also how it is listed in sitemap.xml (only the home page has a trailing slash in the sitemap; all other pages are correct with no trailing slash). So it seems there is a loop and that is why Google isn’t indexing the home page and my rankings are now gone. There are redirects on all trailing slash versions to non-trailing slash versions, as is the expected behavior set by the permalinks. But for some reason, the SEO Framework is presenting domain.com/ as canonical on the home page, and in the sitemap. But that redirects to the non-trailing slash version, which Google is simultaneously being told is not the canonical version. So it looks like a loop with no content to index.
Note: All other pages other than the home page are showing the canonical URL as correctly (i.e. no slash). For some reason the home page is different.
I found nowhere to change this canonical URL of the home page to domain.com. (i.e. without the slash). I have employed a functions.php snippet to manually override the canonical URL of the home page, which overrides the SEO Framework’s canonical URL (domain.com/) in the page code, but this doesn’t change it in the SEO Framework’s sitemap. I don’t really want to hack this with functions.php snippets though.
Furthermore, Google cannot access domain.com/sitemap.xml anyway, and I don’t know why.
How do I fix this? Is there a simple home page canonical setting I have overlooked?
Any help would be much appreciated.
- You must be logged in to reply to this topic.