3

This is my sitemap, it starts like this:

<?xml version="1.0" encoding="UTF-8"?>

<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xhtml="http://www.w3.org/1999/xhtml/"
      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">


<!-- Domain Name Policy (DNP) in: https://github.com/jfoclpf/autocosts/wiki/Domain-name-policy -->

    <url>
        <loc>https://autocostos.info/AR</loc>
        <changefreq>weekly</changefreq>
        <xhtml:link rel="alternate" hreflang="x-default"
                    href="https://autocosts.info/" />

            <xhtml:link rel="alternate" hreflang="es-AR"
                        href="https://autocostos.info/AR" />
            <xhtml:link rel="alternate" hreflang="en-AU"
                        href="https://autocosts.info/AU" />
            <xhtml:link rel="alternate" hreflang="es-BO"
                        href="https://autocostos.info/BO" />
            <xhtml:link rel="alternate" hreflang="pt-BR"
                        href="https://autocustos.info/BR" />
            <xhtml:link rel="alternate" hreflang="en-CA"
                        href="https://autocosts.info/CA" />
            <xhtml:link rel="alternate" hreflang="es-CL"
                        href="https://autocostos.info/CL" />
            <xhtml:link rel="alternate" hreflang="zh-CN"
                        href="https://autocosts.info/CN" />
            <xhtml:link rel="alternate" hreflang="es-CO"
                        href="https://autocostos.info/CO" />
            <xhtml:link rel="alternate" hreflang="es-CR"
                        href="https://autocostos.info/CR" />

But Google Search console insists that

Your Sitemap or Sitemap index file does not properly declare the namespace

They just give an example on line 16: Line 16 Parent tag: url Tag: link

Line 16 corresponds to <xhtml:link rel="alternate" hreflang="x-default" href="https://autocosts.info/" />

What am I doing wrong?

1 Answer 1

0

After searching a lot, I found the solution, I had to have the following urlset:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
    http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
    http://www.w3.org/1999/xhtml
    http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.