jekyll / jekyll-sitemap

Jekyll plugin to silently generate a sitemaps.org compliant sitemap for your Jekyll site
http://rubygems.org/gems/jekyll-sitemap
MIT License
949 stars 134 forks source link

Google Search Console says "Couldn't Fetch" #302

Closed NichtsHsu closed 1 year ago

NichtsHsu commented 1 year ago

I'm using jekyll-sitemap to generate sitemap for my blog, url is https://nihil.cc/sitemap.xml. When I try to add it to sitemap on Google Search Console, it tells me that "Couldn't Fetch". Some say adding a forward slash works, but https://nihil.cc//sitemap.xml still gives me a "Couldn't Fetch".

Can anyone give some suggestions?

cortix commented 1 year ago

You need to make sure that the url in the _config.yml file is set as follows;

url                      : https://nihil.cc
NichtsHsu commented 1 year ago

Hi @cortix ,

Thanks for your reply, I'm sure I have configured it correctly:

https://github.com/NichtsHsu/nichtshsu.github.io/blob/3d3a3846ef4d49602572fff8de90960252b0526a/_config.yml#L27

cortix commented 1 year ago

Interesting!! You can see sitemap.xml in the root directory of the created _site folder, right? I'm just asking to be sure. Maybe the sitemap is not rendering properly.

NichtsHsu commented 1 year ago

You can see sitemap.xml in the root directory of the created _site folder

Yes, it is.

ashmaroli commented 1 year ago

Could you post a screenshot of the actual error rendering on your browser?

NichtsHsu commented 1 year ago

Hi @ashmaroli ,

image

cortix commented 1 year ago

I suppose, the problem is caused by subdomain.

cortix commented 1 year ago

When I looked at the https://gm8.nihil.cc//sitemap.xml, I got this result...

Screenshot 2022-12-29 at 17 42 28

You said earlier that you set the url as "https://nihil.cc". You have to do same thing for subdomain.

ashmaroli commented 1 year ago

@NichtsHsu Thanks for the screenshot. I thought you had added an entry for https://nihil.cc//sitemap.xml as well.. but don't see that in your listing.

ashmaroli commented 1 year ago

Regarding validation, the two links seem good as per following:

ashmaroli commented 1 year ago

@NichtsHsu In the GSC Dashboard Sidebar, try adding the sitemap url to the property https://nihil.cc/ instead of nihil.cc (DOMAIN PROPERTY).

cortix commented 1 year ago

I had gotten a similar error too. If I'm not mistaken, this problem is related to the subdomain. When you set the url as https://nihil.cc in _config.yml, I guess the Jekyll-sitemap plugin creates a sitemap just for it by overriding localhost to https://nihil.cc. I had solved this problem by creating a separate template for the subdomain and in this separate template, I had set the url as subdomain. If you notice,

Your https://gm8.nihil.cc//sitemap.xml shows up like this,

Screenshot 2022-12-29 at 17 42 28

while the other sitemap shows up like this;

Screenshot 2022-12-29 at 18 20 45
NichtsHsu commented 1 year ago

I suppose, the problem is caused by subdomain.

Now I fixed the sitemap of my subdomain, but not improved.

I thought you had added an entry for https://nihil.cc//sitemap.xml as well.. but don't see that in your listing.

When I tried to add https://nihil.cc//sitemap.xml, GSC automatically changed it to https://nihil.cc/sitemap.xml.

try adding the sitemap url to the property https://nihil.cc/ instead of nihil.cc

I tried sitemap.xml and /sitemap.xml:

image

ashmaroli commented 1 year ago

@NichtsHsu The property entry for https://nihil.cc/ look good to me. Let's wait for a couple of days to see if Google's crawlers report positively after getting plenty of time to crawl through every link in /sitemap.xml.

NichtsHsu commented 1 year ago

Response after one month: GSC still can't fetch my sitemap.

But a funny thing happened: the sitemap itself is indexed when none of my new posts are indexed:

image

ashmaroli commented 1 year ago

I feel sorry that this is still an issue, @NichtsHsu. Have you tried reaching out to Google support team? Perhaps, they can tell you what exactly is wrong... 🤷‍♂️

NichtsHsu commented 1 year ago

It seems that there are already a lot of the same issue in the Google search console community, and most people don't get a working solution. I just tested Bing Webmaster Tool and it fetch my sitemap just fine. So it looks like I have nothing to do but fxxk Google.

Emojigit commented 1 year ago

Workaround: Add a redirect from the main (www or apex) website to the target website's sitemap. Below is an example when using Cloudflare Pages redirect:

/sitemap_blog.xml https://blog.example.com/sitemap.xml

Then submit the sitemap URL on the main website (i.e. https://www.example.com/sitemap_blog.xml) to Google.