Configuring hreflang tags for separate language domains
Add self‑referencing and reciprocal hreflang tags in each domain’s head or sitemap, using the correct language‑region codes. Then verify with Google Search Console. Learn about trade‑offs, limitations, and how SeaText automates reciprocal tag generation.
To tell search engines which language version lives on each country‑code domain, place a full set of hreflang annotations on every page. Each domain must reference itself and all other language versions, using the appropriate language‑region code (e.g., fr-FR for example.fr, de-DE for example.de).
What is an hreflang tag?
An hreflang tag is an HTML <link rel="alternate" hreflang="…" href="…"> element. It signals the language and regional targeting of a page. Google uses it to serve the correct version to users based on their language and location. Without it, search engines may treat language versions as duplicates and rank only one, often the wrong one.
Hreflang tags are critical for sites with separate domains per language (ccTLDs like .fr, .de, .es). They prevent duplicate content issues and help preserve SEO equity across markets.
Why correct hreflang matters
- Search engines can index the right page for each market.
- Users see content in their language, improving engagement and conversion.
- Duplicate‑content issues are avoided, preserving ranking signals.
- International traffic is directed correctly, reducing bounce rates.
Prerequisites
- Separate ccTLDs (e.g.,
.fr,.de,.es) already pointing to the correct site. - Consistent URL structure across domains (same path for each language).
- Access to edit the
<head>of each page or to upload a sitemap. - Knowledge of each language‑region code (e.g.,
fr-FRfor French in France,de-DEfor German in Germany).
Step‑by‑step implementation
- List every language version. Create a spreadsheet with columns: Domain, Language‑Region code, URL pattern. For example,
example.frwithfr-FR,example.dewithde-DE,example.eswithes-ES. - Generate the full tag set. For each page, write a
<link>line for every domain, including a self‑reference and anx-defaultentry for the generic version. Here is a concrete example for a product page at path/product/widget:
<link rel="alternate" hreflang="fr-FR" href="https://example.fr/product/widget" />
<link rel="alternate" hreflang="de-DE" href="https://example.de/product/widget" />
<link rel="alternate" hreflang="es-ES" href="https://example.es/product/widget" />
<link rel="alternate" hreflang="x-default" href="https://example.com/product/widget" />
<link rel="alternate" hreflang="en-US" href="https://example.com/product/widget" /> <!-- optional -->
Note the self‑referencing tag: example.fr must reference itself. The x-default tag points to a fallback page (often a global English version). All tags must be reciprocal: if example.fr lists example.de, then example.de must list example.fr.
- Insert tags. Add the generated lines to the
<head>of the page on each domain. Alternatively, place them in an XML sitemap using the<xhtml:link>format. - Make them reciprocal. Ensure that the French page lists the German, Spanish, etc., URLs, and that the German page lists the French, Spanish, etc., URLs back. This is the most common error.
- Validate syntax. Use Google’s hreflang testing tool to catch missing or malformed tags.
- Submit a sitemap. If you use a sitemap, upload it in Google Search Console for each domain.
Trade‑offs: HTML head vs XML sitemap
You can place hreflang tags in the HTML <head> of each page, or in an XML sitemap using <xhtml:link> elements. Each method has trade‑offs.
HTML head: Direct control per page. Google discovers the tags when it crawls the page. But every page must be updated individually, which is error‑prone for large sites.
XML sitemap: Centralized management. You define all language versions for each URL in one file. This is easier to maintain and less prone to missing reciprocal tags. However, Google must first discover the sitemap, and if the sitemap is large, processing may be slower.
Which is better? For small sites with few languages, HTML head works fine. For large multilingual sites, the sitemap approach is recommended because it reduces the risk of missing reciprocal tags.
Trade‑offs: ccTLD vs subdirectory vs gTLD
Separate ccTLDs (e.g., example.fr, example.de) are powerful for local signals but require more complex hreflang management. Subdirectories (example.com/fr/, example.com/de/) are easier to manage because all pages share one domain, and hreflang tags are simpler. gTLDs with subdomains (fr.example.com) fall in between.
If you use ccTLDs, hreflang tags are essential to avoid duplicate content. With subdirectories, you can use hreflang but it is less critical because Google can infer language from the URL structure. However, if you target multiple regions with the same language (e.g., English in the US and UK), hreflang is still needed to serve the correct regional version.
Limitations of hreflang
Hreflang is a hint to search engines, not a directive. Google may ignore it if the tags are inconsistent or if the page content conflicts. For example, if a page has hreflang="fr-FR" but the content is in English, Google may not honor the tag.
Reciprocal tags are required. If you leave out a reciprocal link, Google may not recognize the association. This is the most common cause of hreflang errors.
Google Search Console can take time to reflect changes. After updating tags, it may take days or weeks for the “International Targeting” report to show correct data. Be patient and verify manually using the URL inspection tool.
Hreflang does not work for all search engines. Bing and Yandex have their own methods. Focus on Google, but know that other engines may not use hreflang.
Frequently asked questions
What is x-default and when should I use it?
x-default is a fallback language that does not target any specific language or region. Use it for a generic page that users see when their language is not supported. Often it points to a global English version. For example, hreflang="x-default" href="https://example.com/".
How do I handle the same language in multiple countries?
Use region codes. For English in the US and UK, use en-US and en-GB. Each page must be self‑referencing and reciprocal. If you have a global English page, use en (without region) or x-default.
What is the relationship between canonical and hreflang tags?
Canonical tags tell search engines which URL is the preferred version. Hreflang tags tell search engines which language/region versions exist. They are independent but can conflict. Generally, do not set a canonical to a different language version. Each language version should have a self‑referencing canonical or no canonical. If you use a cross‑domain canonical, hreflang may be ignored.
Can I use hreflang for JavaScript‑rendered pages?
Yes, but Google must be able to see the tags in the initial HTML. If the tags are added by JavaScript after load, they may not be discovered. Use server‑side rendering or include tags in the HTTP response.
Automating hreflang with SeaText
Manual hreflang management is tedious and error‑prone, especially for large sites with many languages. SeaText, the AI‑powered website translation platform, can automatically generate and maintain reciprocal hreflang tags for every translated page.
When you activate SeaText on your WordPress site, it translates your content into up to 125 languages. For each translated page, SeaText automatically adds the correct self‑referencing and reciprocal hreflang tags in the HTML head. It also updates the tags when you add or change pages. This eliminates the most common errors: missing reciprocal tags and incorrect language codes.
SeaText’s approach is built on best practices. It uses the <xhtml:link> format in sitemaps and HTML head tags. It also supports x-default and region‑specific codes. You do not need to manually edit each page.
Further reading and comparison sources
These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.
Learn more
Visit the website for more information.