1

In my Google console, I am getting 1 error and can not understand the given error. All sitemap validators say it is correct but Google does not accept this sitemap.

I edit it for this error and delete this all:

          writer.WriteAttributeString("xmlns:xhtml", "http://www.w3.org/1999/xhtml");
        //writer.WriteAttributeString("xmlns:xsi", "https://www.w3.org/2001/XMLSchema-instance");
        //writer.WriteAttributeString("xsi:schemaLocation", "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd");

But it does not change anything, the error continues. Here is my sitemap content:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://xx.com.tr/tr</loc>
<priority>0.8</priority>
<changefreq>weekly</changefreq>
<link rel="alternate" hreflang="tr" href="http://xx.com.tr/tr"/>
<link rel="alternate" hreflang="de" href="http://xx.com.tr/de"/>
<link rel="alternate" hreflang="en" href="http://xx.com.tr/en"/>
<link rel="alternate" hreflang="x-default" href="http://xx.com.tr/"/>
</url>
<url>
<loc>http://xx.com.tr/de</loc>
<priority>0.8</priority>
<changefreq>weekly</changefreq>
<link rel="alternate" hreflang="tr" href="http://xx.com.tr/tr"/>
<link rel="alternate" hreflang="de" href="http://xx.com.tr/de"/>
<link rel="alternate" hreflang="en" href="http://xx.com.tr/en"/>
<link rel="alternate" hreflang="x-default" href="http://xx.com.tr/"/>
</url>
<url>
<loc>http://xx.com.tr/en</loc>
<priority>0.8</priority>
<changefreq>weekly</changefreq>
<link rel="alternate" hreflang="tr" href="http://xx.com.tr/tr"/>
<link rel="alternate" hreflang="de" href="http://xx.com.tr/de"/>
<link rel="alternate" hreflang="en" href="http://xxxx.com.tr/en"/>
<link rel="alternate" hreflang="x-default" href="http://xx.com.tr/"/>
</url>
<url>
<loc>http://xx.com.tr/</loc>
<priority>0.8</priority>
<changefreq>weekly</changefreq>
<link rel="alternate" hreflang="tr" href="http://xx.com.tr/tr"/>
<link rel="alternate" hreflang="de" href="http://xx.com.tr/de"/>
<link rel="alternate" hreflang="en" href="http://xx.com.tr/en"/>
<link rel="alternate" hreflang="x-default" href="http://xx.com.tr/"/>
</url>
</urlset>

Error is:

Expected: http://www.w3.org/1999/xhtml
Situated: http://www.sitemaps.org/schemas/sitemap/0.9
Main tag: url
tag: link
2

<link> is not part of the Sitemap "protocol", see https://www.sitemaps.org/protocol.html

So you need to remove all of them, which gives you this file that should be accepted by Google:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://xx.com.tr/tr</loc>
<priority>0.8</priority>
<changefreq>weekly</changefreq>
</url>
<url>
<loc>http://xx.com.tr/de</loc>
<priority>0.8</priority>
<changefreq>weekly</changefreq>
</url>
<url>
<loc>http://xx.com.tr/en</loc>
<priority>0.8</priority>
<changefreq>weekly</changefreq>
</url>
<url>
<loc>http://xx.com.tr/</loc>
<priority>0.8</priority>
<changefreq>weekly</changefreq>
</url>
</urlset>

PS: in future cases, please use RFC2606 if you really need to obfuscate names which means basically to use example.com, example.net and .example as domain names and TLDs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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