Search code examples
sitemapgoogle-search-console

Why my sitemap.xml is on error status on searchConsole


im using nodejs sitemap library for building my sitmaps.xml.

Every thing is woking well on my code and

But unfortunately on searchconsole since 2 February i have an Error.

Bad namespace

=> The namespace is incorrectly specified in your index file or sitemap.

So can any one help me?


Solution

  • Have you tried removing xmlns attribute from both loc and lastmod tags? For example on your XML sitemap index:

    <?xml version="1.0" encoding="UTF-8"?>
    <sitemapindex
        xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
        <sitemap>
            <loc>https://sitemap.tmaps.tn/statics.xml</loc>
            <lastmod>2023-03-16</lastmod>
        </sitemap>
        <sitemap>
            <loc>https://sitemap.tmaps.tn/address/1</loc>
            <lastmod>2023-03-16</lastmod>
        </sitemap>
        <sitemap>
            <loc>https://sitemap.tmaps.tn/address/ara/1</loc>
            <lastmod>2023-03-16</lastmod>
        </sitemap>
        <sitemap>
            <loc>https://sitemap.tmaps.tn/address/2</loc>
            <lastmod>2023-03-16</lastmod>
        </sitemap>
        <sitemap>
            <loc>https://sitemap.tmaps.tn/address/ara/2</loc>
            <lastmod>2023-03-16</lastmod>
        </sitemap>
        <sitemap>
            <loc>https://sitemap.tmaps.tn/address/3</loc>
            <lastmod>2023-03-16</lastmod>
        </sitemap>
        <sitemap>
            <loc>https://sitemap.tmaps.tn/address/ara/3</loc>
            <lastmod>2023-03-16</lastmod>
        </sitemap>
    </sitemapindex>