Search code examples
google-search-consolexml-sitemap

Sitemap xml tag error for search console: Invalid XML tag <sitemap>


I am having trouble with submitting this master XML to google with 2 sub-sitemap.xml intact.

When I submit it to search console for indexing, it gives me this error:

Errors Invalid XML tag This tag was not recognized. Please fix it and resubmit. Parent tag: urlset Tag: sitemap

My master sitemap.xml as follow, and thank you for the help~

    <?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.domain.domain/</loc>
    <changefreq>daily</changefreq>
    <priority>0.9</priority>
  </url>
  <sitemap>
    <loc>https://www.domain.domain/sitemap5-0.xml</loc>
        <changefreq>daily</changefreq>
        <priority>1.0</priority>
  </sitemap>
  <sitemap>
    <loc>https://www.domain.domain/sitemap5-1.xml</loc>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
  </sitemap>
</urlset>

Solution

  • You need to replace your sitemap elements with url:

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>https://www.domain.domain/</loc>
        <changefreq>daily</changefreq>
        <priority>0.9</priority>
      </url>
      <url>
        <loc>https://www.domain.domain/sitemap5-0.xml</loc>
            <changefreq>daily</changefreq>
            <priority>1.0</priority>
      </url>
      <url>
        <loc>https://www.domain.domain/sitemap5-1.xml</loc>
        <changefreq>daily</changefreq>
        <priority>1.0</priority>
      </url>
    </urlset> 
    

    This sitemap is valid.