Sitemap is invalid

Hello everybody,
I’m trying to send a Sitemap generated by gatsby-sitemap-plugin.
But when I try to add the sitemap to google, I have “Invalid Sitemap” issue.

Googling around I’m not the only with this problem and, seems is related to permission.

Any help?

Thanks

Hi Giacomo,

As I think I mentioned to you, we can’t really speak to what google thinks about your contents :slight_smile: I did suggest to you the same thing I’d suggest to anyone who wrote in about it:

  1. make sure your build outputs a correct sourcemap, likely by downloading your build as shown in the screenshot (and following the instructions in) this article, to confirm the format is built properly.
  1. if not, debug your build
  2. if so, if you could share a link to your sitemap, I could take a look at our internal logs to see if there have been download errors.
  3. once we resolve 2/3, then if things don’t work, you’d need to contact google about how their service works.

Many customers use sitemaps from netlify successfully so I believe you can succeed and that this isn’t a general brokenness, and happy to help debug as far as we can on our service, once you get things started as described there.

Hi I have a similar problem. I went through all the points. I didn’t find a solution for myself. Have you found a solution to this problem?

Hi, @al-vorotov, we are happy to take a look at the sitemap to see if we can find the root cause. What is the URL for the sitemap where this issue is occurs?

It is here https://alex-vorotov.gq/sitemap.xml Thank you for the opportunity to explore this issue.

The sitemap itself validates. If Google is rejecting it they should provide a reason. I’m not able to reproduce the error you are getting because I’m not able to submit this to their webmaster tools.

My best guess is these two URLs:

https://alex-vorotov.gq/blog/tech/portfolio-on-gatsby-netlife-is-very-fast-and-optimized-part-1
https://alex-vorotov.gq/blog/tech/portfolio-on-gatsby-netlife-is-very-fast-and-optimized-part-2

Both URLs are 301 redirects to the same URL with an ending “/” character. Have you tested changing those URLs to the ones below?

https://alex-vorotov.gq/blog/tech/portfolio-on-gatsby-netlife-is-very-fast-and-optimized-part-1/
https://alex-vorotov.gq/blog/tech/portfolio-on-gatsby-netlife-is-very-fast-and-optimized-part-2/

I thought that was the problem, because it sounds logical. But no, it didn’t help. Google still says that it is not received. I will try to contact Google specialists for an answer.

1 Like

According to this guide possibly related with your robots.txt

Maybe you can add just like this :

User-agent: *
Allow: /
Sitemap: https://alex-vorotov.gq/sitemap.xml

Assuming you are using Gatsby, you can do the following alternatives:

You can install gatsby-plugin-robots-txt for combining with gatsby-plugin-sitemap plugin in gatsby-config.js

Important:
If you are configured any redirect in Netlify UI, for example primary/secondary domain, it will effect your reference the web site with www or not to Host Header in robots.txt

Hi,

@raufsamestone I tried to tweak the gatsby-config.js file but this default gatsby plugin does not seem to be installable.

Any ideas? :slight_smile:

Thanks!

Hi, @Obitron. Are you having an invalid site map issue? If not, please let us know and I’ll split this question off into a new topic.

If you are having a sitemap issue, what is the URL for the site map which isn’t working?

From the screenshot above, it appears that this package (“gatsby-plugin-robots-txt”) is missing from your package.json. Would you please confirm it is there? If so, would you post that section of the file here?

@luke right. let me have a double check because something odd is happening, so, it will be better for me to have the issue explained for myself to before making you a tough day. Thanks!