
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 Hreflang generator now!
Experiencing challenges with Hreflang annotations or geo-targeting? Get a Google Spreadsheet where you can generate Hreflang code in an instant.
Get Spreadsheet for FreeccTLDs
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 do 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:
- 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.
- Choose Your Implementation Method: Decide whether you’ll be using subdirectories, subdomains, or ccTLDs (country code top-level domains) for different language versions.
- 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.
- 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.
- 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.
- 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.
- 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.
Technical SEO for International Websites: The Role of Hreflang
Hreflang tags tell search engines which language or regional version of a page to show, making them important for websites with global audiences. Including them in an XML sitemap helps avoid duplicate content issues and ensures users see the most relevant version of your content.
Depending on your strategy, you can implement hreflang using subdomains, subdirectories, or ccTLDs. Each option has its strengths: subdirectories are simple to manage, ccTLDs perform well locally, and subdomains offer flexibility. The right choice depends on your resources and goals, but hreflang can make a significant difference in how well your site performs internationally.

If you’re still unsure, just shoot me a message, and we can figure out together.
Hreflang sitemap Q&A
What is a Hreflang sitemap, and why is it important?
A Hreflang sitemap (or a sitemap hrefalng) 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.
An XML sitemap with properly implemented hreflang attributes typically includes:
- URLs for each language version of a webpage.
- Hreflang annotations (or tags) to indicate the language and region for each URL.
- A canonical reference that connects all versions of the same content to prevent duplicate indexing issues.
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 does an XML sitemap look like?
Understanding how to structure an XML sitemap with hreflang attributes is essential for implementing multilingual SEO strategies. Below is a downloadable example of a basic hreflang sitemap that includes annotations to guide beginners.
[Hreflang sitemap for subfolders] [Hreflang sitemap for subdomains] [Hreflang sitemap for TLDs]
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
Martin Kura works with B2B SaaS teams to clarify growth priorities using search and market data. His background spans 16+ years in international SEO, multilingual content, and cross-cultural marketing.
