Facing sitemapindex error in google search console

johnthan

New member
Joined
Nov 17, 2016
Messages
6
Points
1
I am not sure if it is a good section to post this question.

I am facing the sitemap submission error on Google search consoles. It says "sitemap index can be read, but has error".

The reason is: Your sitemap or Sitemap index file doesn't properly declare the namespace.

Examples:
Line 1
Tag: sitemapindex

Below is my xml code
Code:
<sitemapindex xmlns="http://www.sitemaps.org/schema/sitemap/0.9">
<sitemap>
<loc>https://...../sitemap/posts</loc>
</sitemap>
</sitemapindex>
Can you tell me the correct format or point out the mistake I have done there?
 

Purres

Member
Joined
Apr 22, 2016
Messages
72
Points
8
Best answer
The namespace declaration in your XML code is missing the xsi attribute, which is required by the Sitemap protocol. Here is the corrected code:

PHP Code:
Code:
<sitemapindex xmlns="http://www.sitemaps.org/schema/sitemap/0.9"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://www.sitemaps.org/schema/sitemap/0.9
                                  http://www.sitemaps.org/schema/sitemap/0.9/sitemap.xsd">
  <sitemap>
    <loc>https://...../sitemap/posts</loc>
  </sitemap>
</sitemapindex>
With this correction, the sitemap index file should now be properly declared and recognized by Google Search Console.

Hope it helps!
 
Older threads
Replies
0
Views
3,928
Replies
0
Views
3,550
Replies
8
Views
3,218
Replies
3
Views
3,388

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top