2

I have generated this sitemap.xml file :

<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->

  <url>
    <loc>https://maths-pour-tous.netlify.app/</loc>
    <lastmod>2022-10-09T16:34:11+00:00</lastmod>
    <priority>1.00</priority>
  </url>
  <url>
    <loc>https://maths-pour-tous.netlify.app/liens</loc>
    <lastmod>2022-10-09T16:34:11+00:00</lastmod>
    <priority>0.80</priority>
  </url>
</urlset>

This file is recognized to be it, but it contains errors. In fact, it seems to appear as an HTML file according to Google Search Console.

your sitemap.xml seems to be an HTML page

13
  • Are you sure that those are the contents of the file? How are you looking at it? Its isnt an html rendition perhaps ? Are you using wordpress ? Have a look at this Fixing “Your Sitemap Appears to Be an HTML Page” in Google Search Console Oct 11, 2022 at 11:00
  • I'm using reactJs, so i added this file myself in the project.
    – jozinho22
    Oct 11, 2022 at 16:19
  • The structure and entries appear to be the same as mine. The only line I don't use is lastmod. Maybe there is an error there. I read Google doesnt care about the lastmod. And the Browsers need it on the page header Oct 19, 2022 at 19:03
  • 1
    I also found a reference to a Youtube video from John Mueller about errors with sitemap files. Where he says that "if you change the name of the sitemap file, it can reset things on Google's end." So, give it a try. Oct 20, 2022 at 13:21
  • 1
    @jozinho22, I see that you present your own error page for non-existent pages. However, you are returning code 200. I am not an expert, but that doesn't seem like a good strategy. Sure, have a custom error page, I do. But you should return 404. Oct 21, 2022 at 3:40

1 Answer 1

1

According to John Mueller, sometimes there is a quirk with sitemap files. And he has seen that if you change the name of the file, sometimes it can reset things at Google's end.

Since it's a video, I can't quote a snapshot here. The discussion starts at 52:49 mark into the video

Try renaming it. It doesn't has to be called sitemap

2
  • Thank you for the advice, but that didn't solve the problem. As well, I don't think I would change the file name each time I edit it...
    – jozinho22
    Oct 21, 2022 at 14:01
  • Not each time, it was supposed to be once. Oct 21, 2022 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.