Hreflang is an HTML attribute that tells search engines which language and regional version of a page to show each user. If your business publishes the same content for different countries or languages, hreflang helps the right version reach the right people. Used correctly, it prevents your own pages from competing with each other and gives international visitors a version they can actually read and act on.
Hreflang is one of the most useful international SEO signals, but it is also one of the easiest to get wrong. A missing return tag or a typo in a language code can cause search engines to ignore the whole set. This guide explains how hreflang works, how to write the tags correctly, how it interacts with canonical tags and x-default, and how to check that the right version is showing.
Why hreflang matters for international SEO
Without hreflang, search engines have to guess which version of a page to show. A visitor in France might see your English page even though a French version exists. Worse, near-identical pages in different languages can look like duplicate content, so search engines may choose one version and drop the others from results.
Hreflang does not boost rankings by itself. It is a targeting signal. Its job is to match each user with the most suitable version, which usually means more relevant visits and better engagement from every market you serve.
Hreflang syntax explained
Hreflang tags are added to the head of each page, or in an XML sitemap, or in HTTP headers for non-HTML files such as PDFs. A basic set of tags looks like this:
<link rel="alternate" hreflang="en-us" href="https://example.com/us/" /><link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" /><link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/" />
The language value uses an ISO 639-1 language code, such as en or fr. The optional region value uses an ISO 3166-1 alpha-2 country code, such as us, gb or fr. Keep the format lowercase for the language and pair it with the region using a hyphen. A value such as en-uk is invalid, because the correct country code for the United Kingdom is gb.
Using x-default for unmatched visitors
The value x-default tells search engines which page to show when no other version fits the user's language or region. It is usually a language selector page or your main international homepage. Adding it gives you a sensible fallback instead of leaving visitors to see an arbitrary version.
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
How hreflang works with canonical tags
Each hreflang page should point its canonical tag to itself. If a French page canonicalises to the English version, search engines are told that the French page is not a separate version, and the hreflang annotation is effectively ignored. Canonical and hreflang must agree.
Every language version must also list all the others, including itself. This is what people call the return tag. If the English page points to the French page but the French page does not point back, search engines may disregard the connection. Build your hreflang set as a complete loop, and make sure each URL in the set returns a live page with a 200 status code.
Common hreflang mistakes that cost visibility
The most frequent problem is missing return tags, where only one side of a pair is annotated. The second most common is using the wrong codes, such as en-uk, or mixing language and region in the wrong order. Some sites also link hreflang to URLs that redirect, which means the target is not the final version a user would see.
Other issues include pointing hreflang to pages blocked by robots.txt or marked noindex, mixing hreflang in the head with a conflicting sitemap, and translating only part of a site while linking the incomplete pages as full equivalents. Each of these can stop search engines from showing the intended version.
How to check the right version shows
Start by checking your key pages for self-referencing tags, reciprocal return tags and a valid x-default. Crawling tools can confirm the full set quickly, and reviewing a sample by hand helps you spot patterns that automated checks may miss.
Next, use Google Search Console's URL Inspection tool to see which version Google has indexed for a given URL. If the wrong regional page appears in search results, look for conflicting signals such as canonical errors, redirects or missing tags. You can also search Google with the relevant country settings in a private browser window to see which version a local user is likely to find.
Finally, review performance by market. In Search Console, compare impressions and clicks for each regional version, filtered by country, to confirm that users in each market land on the right page. A sudden shift in traffic between regional versions often signals a hreflang or canonical problem worth investigating.
Choosing the right hreflang implementation method
You can place hreflang annotations in three locations: the HTML head of each page, an XML sitemap, or HTTP headers. The head is the most common choice for web pages because it sits next to the content it describes and is easy for developers to update in a template. Sitemaps suit large sites where editing hundreds of templates is impractical, since every language relationship can live in one file. HTTP headers are the practical option for PDFs and other non-HTML files.
Whichever method you choose, use it consistently across the whole site. Mixing methods for the same set of URLs can create conflicting signals and make errors harder to diagnose. Document the structure in a simple spreadsheet that lists each URL, its language code and its matching versions, so content teams and developers work from the same source of truth.
Get hreflang set up correctly
Hreflang is easy to explain and surprisingly easy to break, especially on large sites with many markets. If you are planning a multilingual or multi-country website, or you suspect the wrong version is ranking, ClicZeo can audit your current setup, map each market to the right page and implement a clean hreflang structure. Contact us to request an international SEO review and a clear list of fixes in priority order.