+3 votes
in Web & Google by (54.1k points)

Google search console is giving the following error for one of my sitemaps.

Sitemap can be read, but has errors

Your Sitemap or Sitemap index file doesn't properly declare the namespace.

Incorrect namespace

How can I fix this error?

1 Answer

+1 vote
by (233k points)
selected by
Best answer

If you are using 'https' instead of 'http' for websites www.sitemaps.org or www.w3.org, Google search console will give the above error. So, to fix the error, replace

https://www.sitemaps.org/* and https://www.w3.org/*


http://www.sitemaps.org/* and http://www.w3.org/*  respectively.


<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">