1

Masters,

We translated our site to english and im little bit confused about sitemap.xml. Till now, we have a sitemap 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">
<url>
    <loc>http://mysite.hu</loc>
    <lastmod>2012-12-12</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.7</priority>
</url>
<url>
    <loc>http://mysite.hu/cegbemutato.php</loc>
    <lastmod>2012-12-12</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.6</priority>
</url>
<url>
    <loc>http://mysite.hu/termekeink.php</loc>
    <lastmod>2012-12-12</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.6</priority>
</url>
</urlset>

The translated files under "EN" folder. http://mysite.hu/en/

I found two methode on google, and i don't know which one i should use, and how to do it.

  1. http://support.google.com/webmasters/bin/answer.py?hl=en&answer=2620865

  2. Second is the Sitemap index file

This is how it should look like? So have to take all my url twice?

<?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">
  <url>
    <loc>http://mysite.hu/</loc>
    <xhtml:link 
                 rel="alternate"
                 hreflang="en"
                 href="http://mysite.hu/en/"
                 />
    <xhtml:link 
                 rel="alternate"
                 hreflang="hu"
                 href="http://mysite.hu/"
                 />


  <url>
    <loc>http://mysite.hu/en/</loc>
    <xhtml:link 
                 rel="alternate"
                 hreflang="hu"
                 href="http://mysite.hu/"
                 />

     <xhtml:link 
                 rel="alternate"
                 hreflang="en"
                 href="http://mysite.hu/en/"
                 />
  </url>


    <url>
    <loc>http://mysite.hu/cegbemutato.php</loc>
    <xhtml:link 
                 rel="alternate"
                 hreflang="en"
                 href="http://mysite.hu/en/about-us.php"
                 />
    <xhtml:link 
                 rel="alternate"
                 hreflang="hu"
                 href="http://mysite.hu/cegbemutato.php"
                 />


  <url>
    <loc>http://mysite.hu/en/about-us.php</loc>
    <xhtml:link 
                 rel="alternate"
                 hreflang="hu"
                 href="http://mysite.hu/cegbemutato.php"
                 />

     <xhtml:link 
                 rel="alternate"
                 hreflang="en"
                 href="http://mysite.hu/en/about-us.php"
                 />
  </url>
</urlset>

Or use the sitemap_index.xml methode and simple make an alternative sitemap to EN content? Thank you for any suggestion.

holian
  • 227
  • 1
  • 8
  • 14

1 Answers1

2

The way you have created your new sitemap is correct. Each URL is listed only once inside <loc> tags but next to those are all the alternative URLs for the same page in other languages so it might seem that you are listing everything three times.

A sitemap index is used when you outgrow a single sitemap file. Sitemap files have a limit of 50,000 URLs (in <loc> tags) so if you have more than 50,000 URLs in your site, you will need multiple sitemaps and a sitemap index to list them all.

Sitemaps also have a limit of 10MB and if you have more than two languages it wouldn't be too hard to exceed this limit before reaching 50,000 URLs.

You can still include the <lastmod>, <changefreq> and <priority> tags inside each <url> tag but remember they only apply to the URL in the <loc> tag, not the alternate language links.

You can also gzip your sitemaps to help lower bandwidth and CPU costs.

Ladadadada
  • 25,847
  • 7
  • 57
  • 90