• Resolved jason9j

    (@jason9j)


    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    The root URL of a website (aka “homepage”) must always have a slash at the end. If it’s missing, it’s implied.

    From RFC 3986 3.3 (2005):

    path-abempty ; begins with “/” or is empty

    Translated: both “/” and empty are considered an empty path of an absolute or empty URL. Ergo, “/” and empty are the same path.

    The WHATWG URL Living Standard says that an input of https://example.com/ has a path that equals “the empty string.”

    You can confirm this yourself by removing or adding the trailing slash to any site’s URL, and you should always land on the same page. If you inspect the request headers in a Chromium browser’s developer tools (what Google also uses to inspect sites), you’ll find that the Request URL always gets the trailing slash appended, whether you wrote it or not.
    This also works on Firefox, where they even state that the path is “/” when you leave it empty.

    Back in 2019, when TSF was still agnostic about the trailing slash, a user found that removing the trailing “/” from the permalink settings made the homepage partially invisible to Google.

    So, considering all this, I have enforced a trailing slash for the homepage since TSF v3.2.4 (here’s it in action). I would be surprised if other SEO plugins didn’t do this because Google reported an issue about the user’s site otherwise.

    Perhaps another plugin on your site is acting unexpectedly when it comes to the trailing-slash situation, maybe also affecting the sitemap’s locability. If you have a URL of the site affected, I’d love to take a closer look. If you’d rather keep that confidential, please forward it to me at https://tsf.fyi/contact.

    I’m also interested in whether your site is using 302 or 301 redirects for the URL changes, but I’ll find that out soon enough once I have a URL to inspect. Cheers!

    Thread Starter jason9j

    (@jason9j)

    Hi Sybre – thank you for your comprehensive reply. I have sent you the details directly and really appreciate your assessment of what is happening. Many thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.