Hreflang XML Sitemap: 3 Examples You Can Steal

10/07/2021by Martin Kura0
hreflang-sitemap.jpg

In order to tell Google and other search engines which language/country version is intended for which audience, you can use a Hreflang sitemap.

A Hreflang sitemap indicate how the language/country versions are related. Each URL that has an equivalent in another language/country should be specified in a separate row of the sitemap. You need to add the URL itself with all its equivalents.

Below are some examples of what a Hreflang sitemap could look like for subdirectories, ccTLDs and subdomains.

Subdirectories

Versions:

  • example.com (English)
  • example.com/de (German)
  • example.com/fr (French)
<?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>https://example.com</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com"/>
<xhtml:link rel="alternate" hreflang="de" href="https://example.com/de"/>
<xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr"/>
</url>
<!-- Other URL entries go here -->
</urlset>

Subdomains

Versions:

  • example.com (English)
  • de.example.com (German)
  • fr.example.com (French)
<?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>https://example.com</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com"/>
<xhtml:link rel="alternate" hreflang="de" href="https://de.example.com"/>
<xhtml:link rel="alternate" hreflang="fr" href="https://fr.example.com"/>
</url>
<!-- Other URL entries go here -->
</urlset>

Get Your Hreflang Checked by Martin!

Experiencing challenges with Hreflang annotations or geo-targeting? Allow me to validate and resolve any issues.

Explore Hreflang Services

ccTLDs

Versions:

  • example.com (English)
  • example.de (German)
  • example.fr (French)
<?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>https://example.com</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com"/>
<xhtml:link rel="alternate" hreflang="de" href="https://example.de"/>
<xhtml:link rel="alternate" hreflang="fr" href="https://example.fr"/>
</url>
<!-- Other URL entries go here -->
</urlset>

Hreflang Sitemap Generators

You can also use dedicated XML sitemap generators to create a Hreflang sitemap.

How to I create a sitemap with Hreflang tags

Creating a sitemap with Hreflang tags involves a few key steps, which help to tell search engines which language or country version of a webpage is intended for a particular audience. Here’s a guide to help you get started:

  1. Identify Your Target Languages/Countries: Determine the languages and countries you’re targeting and map out the URLs that have equivalents in other languages or regions.
  2. Choose Your Implementation Method: Decide whether you’ll be using subdirectories, subdomains, or ccTLDs (country code top-level domains) for different language versions.
  3. Write the Hreflang Tags: Create Hreflang tags for each URL that has an equivalent in another language or region. Look for examples in the article above.
  4. Create the XML Sitemap: Combine all the tags into an XML sitemap following the standard sitemap protocol. Use the appropriate XML version, encoding, and namespaces to ensure compliance with XML schema.
  5. Validate Your Sitemap: Before uploading the sitemap, validate it using an XML sitemap validator or a dedicated Hreflang sitemap validation tool to check for errors.
  6. Submit the Sitemap to Search Engines: Use Google Search Console or other search engine-specific tools to submit your sitemap, so search engines can recognize and crawl your localized URLs.
  7. Monitor and Maintain: Regularly check the sitemap and Hreflang tags for errors and make updates as needed. This will ensure that search engines continue to index your localized content correctly.

Hreflang sitemap Q&A

What is a Hreflang sitemap, and why is it important?

A Hreflang sitemap is a tool that helps search engines understand which language and country versions of a page are available. It ensures that the correct language version of a website is displayed to users in different regions, enhancing user experience and SEO performance.

Can I use Hreflang tags without a sitemap?

Yes, you can implement Hreflang tags in the HTML header of individual pages instead of using a sitemap. Both methods are valid, but using a sitemap can make managing Hreflang annotations for large websites more efficient.

What are common mistakes when implementing Hreflang sitemaps?

Common mistakes include using incorrect language or country codes, failing to include a return tag, and not keeping the sitemap updated as content changes. These errors can lead to incorrect indexing by search engines.

How do I choose between subdirectories, subdomains, or ccTLDs for my international website?

The choice depends on factors like target audience, budget, SEO strategy, and technical considerations. Subdirectories may be easier to manage, while ccTLDs may offer better localization. Consulting with an SEO expert can help you make the best decision for your specific situation.

Are there any tools to generate and validate Hreflang sitemaps?

Yes, several tools and plugins can help you generate and validate Hreflang sitemaps.

What happens if I don’t implement Hreflang correctly?

Incorrect implementation of Hreflang may lead to search engines showing the wrong language or regional version of your site to users. This can negatively impact user experience and SEO performance.

Can I implement Hreflang tags if my website is only in one language but targets multiple countries?

Yes, you can use Hreflang tags to target different countries with the same language content, providing that you have a dedicated version for each market. This can help guide search engines to display the most relevant regional version of your site.

How often should I update my Hreflang sitemap?

You should update your Hreflang sitemap whenever there are changes to the URLs, language versions, or country targeting of your site. Regular monitoring and updating ensure that search engines always have the latest information.

Martin Kura

A multi-cultural nerd, digital marketer and SEO/content enthusiast. Likes good beer, dry wine, loves to cook and sing (sometimes all at once).


Leave a Reply

Your email address will not be published. Required fields are marked *