+2 votes
in Web & Google by (11.2k 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

0 votes
by (16.1k points)

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/*

with

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

E.g.

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

...