International SEO & Hreflang · Lesson 01 of 4

Understanding Hreflang Tags

Learn how hreflang tags tell Google which language and regional version of a page to serve, and how to avoid the common mistakes that cost exporters visibility.

A Thai frozen-food exporter built a German-language website to target buyers in Munich and Berlin. Every page was carefully translated, product images showed German packaging, and prices were listed in euros. Yet six months later, the site was barely visible in German search results. When the exporter checked, they discovered that Google was serving the Thai-language version to German searchers and the German version to Thai searchers. The problem was not the content — it was the complete absence of hreflang tags, leaving Google to guess which language belonged to which audience.

Hreflang tags are the single most important technical signal for international SEO. They tell Google, Bing, and other search engines which language and regional version of a page to display to a user based on their location and language settings. Without them, search engines must infer your targeting from weak signals like the page language, the TLD, or backlink profiles — and they frequently get it wrong, especially for exporters running multiple language versions of the same site.

For exporters, correct hreflang implementation is not optional. If you have a dedicated page for Vietnamese buyers in Vietnamese, a page for German buyers in German, and a global English page, hreflang is what ensures each audience sees the right version. When hreflang is missing or incorrect, you risk duplicating your SEO effort across markets, confusing search engines, and ultimately losing visibility in every market you are targeting.

Hreflang Syntax and Structure

An hreflang tag is a simple HTML link element that pairs a language-and-region code with a URL. The basic syntax is <link rel="alternate" hreflang="de" href="https://example.com/de/" />. The language code follows the ISO 639-1 standard (two letters like "de" for German, "vi" for Vietnamese), and an optional region code follows ISO 3166-1 alpha-2 (such as "de-DE" for Germany, "de-AT" for Austria). The x-default tag acts as a fallback for users whose language or region is not explicitly covered.

Every page in a language group must link to every other page in that group, including itself. This is the aspect exporters most frequently miss — they add hreflang to the German version pointing to the English version but forget to add the reciprocal tags on the English version pointing back to the German version. Google requires full bidirectional linking. If page A links to page B with hreflang but page B does not link back, Google may ignore the annotation entirely.

The region code is critical when you target the same language in multiple countries. A Spanish page for Spain (es-ES) and a Spanish page for Mexico (es-MX) need distinct hreflang annotations. Without the region qualifier, Google cannot distinguish between them and may serve the wrong regional variant. Exporters selling to both Spain and Latin America must use region-qualified codes to keep their targeting precise.

Implementation Methods: HTML, HTTP Headers, and Sitemaps

There are three supported ways to implement hreflang, and you only need one. The most common is the HTML link element in the <head> section of each page. This works well for smaller sites with clear page-per-language mapping. Each page includes a full set of <link rel="alternate"> elements for every language version. The HTML method is the easiest to audit and debug, making it the best starting point for most exporters.

For large sites with hundreds or thousands of pages per language, the HTML method becomes unwieldy. Google also supports hreflang in HTTP headers, which you can set at the server level for non-HTML resources like PDFs. The sitemap approach is the most scalable for exporters with extensive product catalogs in multiple languages. You include hreflang annotations directly in your XML sitemap using <xhtml:link> elements, keeping the markup out of your HTML while maintaining full coverage. Many e-commerce platforms like Shopify and Magento support sitemap-based hreflang through plugins.

Whichever method you choose, consistency is essential. If you declare hreflang in your HTML but your sitemap contradicts those declarations, Google has to reconcile the conflict and may fall back to guessing. Pick one method, validate it thoroughly, and do not mix approaches across sections of your site unless you have a strong reason and a clear mapping strategy.

Common Mistakes and How to Debug Them

The most frequent hreflang mistake is missing the return link. As noted above, hreflang must be fully reciprocal. If your German page links to your English page but the English page does not link back, Google treats the entire group as invalid. The second most common error is using incorrect language or region codes — writing zh-cn instead of zh-Hans for simplified Chinese, or using three-letter codes. Always verify your codes against the ISO registries before deploying.

Another pervasive error is mixing hreflang directions within a group. Every page in the group must declare the exact same set of language-URL pairs. If your German page lists five languages but your English page lists only four, the group is broken. Similarly, if one page uses region-qualified codes (en-US) while another uses only language codes (en), Google may not recognise them as part of the same group. Standardise your approach across every page in the group.

Google Search Console provides an International Targeting report under the Legacy tools and reports section that shows hreflang errors, missing return tags, and unannotated pages. Use this report as your primary debugging tool. Third-party crawlers like Screaming Frog and Merkle's hreflang validator can also scan your full site and flag inconsistencies. Run a full hreflang audit at least quarterly, and always after adding a new language version.

Do This Now
  1. Identify every language and regional version of your website and list the exact ISO 639-1 language code and ISO 3166-1 region code for each.
  2. Choose an implementation method (HTML head, HTTP headers, or sitemap) and apply hreflang tags to every page in every language version, ensuring full reciprocal linking.
  3. Add an x-default tag pointing to your primary global page as a fallback for uncovered languages and regions.
  4. Run Google Search Console's International Targeting report and fix every error it flags, then schedule a quarterly audit to catch regressions.

Frequently Asked Questions

Yes, and you should. IP-based redirects alone are unreliable because they override a user's explicit language preference. A German executive travelling in Japan on a Japanese IP will get the Japanese version even though they want German. Hreflang tags give Google the information it needs to override IP-based guesses with the user's actual search settings and browsing history. Ideally, use IP detection as a soft suggestion and let hreflang plus a visible language switcher handle the final decision.

You need hreflang tags on every page that has a corresponding page in another language. If your entire catalogue is available in English, German, and Vietnamese, then every product page needs hreflang annotations linking the three versions. If only your homepage and about page are translated, only those pages need tags. The rule is simple: if a page has a direct equivalent in another language, it must carry hreflang annotations. Pages that exist in only one language do not need them.

Bad hreflang does not cause a manual penalty, but it effectively wastes your SEO investment in every market. Google may serve the wrong language version to searchers, dilute authority by treating your pages as duplicates, or simply ignore your annotations and guess — which is often worse than having no tags at all. In the worst case, Google selects a default version that is not the market you care about, and your carefully localised content never reaches the audience it was built for. Fixing hreflang errors typically produces a noticeable ranking recovery within two to four weeks of correction.