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,897
Replies
0
Views
3,542
Replies
8
Views
3,194
Replies
3
Views
3,357
Latest threads
Recommended threads
Replies
46
Views
18,012
Replies
4
Views
3,643
Replies
10
Views
4,065

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