title: sitemap.xml for multi language pages
body: <p>I run a multi language web page with two languages. I'm wondering how to prepare the <code>sitemap.xml</code> file friendly for Google search engine.</p>
  
  <p>For main site address <code>example.com</code>, the default language is <code>pl-PL</code>. The simple language code is <code>pl</code>. The second language is <code>en-GB</code> with simple code <code>en</code>.</p>
  
  <p>So the first address with default language is: <code>example.com</code></p>
  
  <p>The same page with the first lang code: <code>example.com/pl/</code> (domain name with simple language code) is the same page.</p>
  
  <p>And the same page is also for <code>example.com/pl/home-page/</code> (language-code/site-code)</p>
  
  <p>So main page with dafault language has 3 copies.</p>
  
  <p>The second language is <code>en</code> with address <code>example.com/en/</code> and <code>example.com/en/home-page/</code>.</p>
  
  <p>Following the Google advises for multi language sites:</p>
  
  <blockquote>
    <p>If two sides do not point to each other, the tags will be ignored. Thanks to this, no one can create a tag on another site pointing to any page as an alternative version of one of your pages.</p>
  </blockquote>
  
  <p>the sitemap.xml should look like</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
  &lt;url&gt;
      &lt;loc&gt;https://example.com/&lt;/loc&gt;
      &lt;xhtml:link rel="alternate" hreflang="pl-PL" href="https://example.com/" /&gt;
      &lt;xhtml:link rel="alternate" hreflang="pl-PL" href="https://example.com/pl/" /&gt;
      &lt;xhtml:link rel="alternate" hreflang="pl-PL" href="https://example.com/pl/home-page/" /&gt;
      &lt;xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/en/" /&gt;
      &lt;xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/en/home-page/" /&gt;
      &lt;priority&gt;1.00&lt;/priority&gt;
  &lt;/url&gt;
  &lt;url&gt;
      &lt;loc&gt;https://example.com/en/&lt;/loc&gt;
      &lt;xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/en/" /&gt;
      &lt;xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/en/home-page/" /&gt;
      &lt;xhtml:link rel="alternate" hreflang="pl-PL" href="https://example.com/" /&gt;
      &lt;xhtml:link rel="alternate" hreflang="pl-PL" href="https://example.com/pl/" /&gt;
      &lt;xhtml:link rel="alternate" hreflang="pl-PL" href="https://example.com/pl/home-page/" /&gt;
      &lt;priority&gt;1.00&lt;/priority&gt;
  &lt;/url&gt;
  &lt;/urlset&gt;
  </code></pre>
  
  <p>Google Search Console accepts this file but I want to ask if there is redundace?
  My simples version could be:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
  &lt;url&gt;
      &lt;loc&gt;https://example.com/&lt;/loc&gt;
      &lt;xhtml:link rel="alternate" hreflang="pl-PL" href="https://example.com/" /&gt;
      &lt;xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/en/" /&gt;
      &lt;priority&gt;1.00&lt;/priority&gt;
  &lt;/url&gt;
  &lt;url&gt;
      &lt;loc&gt;https://example.com/en/&lt;/loc&gt;
      &lt;xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/en/" /&gt;
      &lt;xhtml:link rel="alternate" hreflang="pl-PL" href="https://example.com/" /&gt;
      &lt;priority&gt;1.00&lt;/priority&gt;
  &lt;/url&gt;
  &lt;/urlset&gt;
  </code></pre>