I am trying to submit my sitemap generated by Hugo and hosted on Netlify to Google Search Console, but I receive an error, where Google Search Console gives the sitemap status as “Couldn’t Fetch” (tried to include images of this behavior in this post, but the Discourse installation won’t let me since I"m a new user).
There is a related discussion on the Hugo discussion board here, where bep suggests that the error is due to a misconfigured baseURL in config.toml. Initially, my baseURL was misconfigured as “/”, and I changed it to the correct URL.
When I submit my sitemap through a validation tool by Yandex, I receive no errors (tried to link to this validation tool, but again, the Discourse installation won’t let me insert more than two links).
I would greatly appreciate any help from the community - thanks!
It looks like the problem may be upstream: https://support.google.com/webmasters/thread/3836590?hl=en . Annoying, but I guess I’ll just wait a week and see what happens.
Quick update in case anyone else faces similar issues:
This is definitely a problem with Google; I submitted my sitemap to Bing, and it went through within minutes.
An update for people who stumble upon this issue.
For me the /favicon.ico was returning a 404, and I think that was the reason why Google thought it couldn’t fetch (since not all requests to the page were successful). I added a favicon and it seemed to do the trick for me.
Go to your site
/sitemap.xml with the browser dev tools open, and make sure all requests on that page return a status 200
I also added an empty
_index.md with the
date attribute to ensure the sitemap added a
lastmod for the root URL. That could also have contributed to it starting working.
Edit: Tried it on another site and it didn’t work
For me I just want to know how to even make hugo generate sitemaps.
Does it generates them by default?
See Custom Output Formats | Hugo
A single Sitemap template is used to generate the
sitemap.xml file. Hugo automatically comes with this template file. No work is needed on the users’ part unless they want to customize
Although, in future please create new topic for a new question. In this case search for `sitemap’ on the Hugo Docs site would be sufficient to answer the question.
This topic was automatically closed after 23 hours. New replies are no longer allowed.