What is hreflang?
Hreflang is an HTML attribute. It tells search engines which language a page is written in and which geographical audience it is for. The purpose is simple: the search engine should show the right version of the page to users searching from different countries or in different languages. Hreflang therefore brings structure to your international content, and users always encounter content that feels locally relevant.
The attribute works by indicating the relationships between the pages in the different language versions. It's a signal, not a requirement. Search engines, Google in particular, use the signal when assessing which page suits the user best. So hreflang doesn't affect your rankings directly. It strengthens your SEO work indirectly, because the search results become more precise. If you work with international visibility, hreflang is therefore an important part of your overall SEO setup. It sits alongside technical optimisation, link structure and sitemaps.
How do you use hreflang?
You can set up hreflang in three ways: in HTML, in the HTTP header or in XML sitemaps. Most people place it in the <head> section of each page. Here, you specify the language and, optionally, the region using ISO codes. ISO 639-1 covers the language, and ISO 3166-1 Alpha 2 covers the country. Together, they give a syntax such as “da-DK” for Danish targeting Denmark or “en-US” for English targeting the USA.
A typical HTML setup looks like this:
<link rel="alternate" hreflang="es-es" href="http://example.com/" />
<link rel="alternate" hreflang="fr-fr" href="http://example.com/fr/" />
<link rel="alternate" hreflang="pt-pt" href="http://example.com/pt/" />
Each page should refer to itself and to its language alternatives. That way, search engines understand the relationships correctly. You get the best effect when the setup is reciprocal: all versions point back to each other. If you work with a larger website, it's a good idea to consolidate the setup in XML sitemaps. That gives you a better overview and easier maintenance.
Hreflang becomes particularly relevant when you work strategically with your international presence in Google Ads or SEO. When your campaigns and your organic content match users' language and culture, you improve both performance and user experience. That requires the setup to be right. Otherwise, you risk search engines mistaking your pages for duplicate content.
Why you should use hreflang
Hreflang is first and foremost about relevance. If you use it correctly, the search engine shows users the pages that match their language and country. Fewer visitors end up in the wrong place, and your bounce rate drops, because users land on pages they can understand and relate to. At the same time, you tell search engines that your language versions are intended variants of the same page, not duplicates. That protects your organic visibility.
In practice, hreflang improves your conversion potential across markets, because the experience feels more targeted. If you combine a correct setup with, for example, locally adapted content and targeted paid social, you often see more consistent performance across channels. The explanation is simple: users get a coherent experience all the way from ad to landing page.
What types and variants are there?
Hreflang comes in two main types: language- and region-specific setups, and x-default. The language- and region-specific versions follow the pattern “language-country”, e.g. en-US or da-DK. You use them when a page is aimed at a specific market. If the content isn't limited to a region, you can simply specify the language on its own, such as en or da.
x-default is your fallback. It kicks in when a user's language or region doesn't match any specific variant. It usually points to a global homepage or a language selector, where users choose the version themselves. This gives users a better experience than if you sent everyone to one particular country page.
How do you use hreflang in practice?
Only use hreflang if you genuinely have content in several languages or for several markets. Otherwise, it just adds unnecessary complexity. Start by mapping your language versions. Then check that your URL structure can support them. Once the structure is in place, set up hreflang for each version. Test the result in Google Search Console. There, you can see whether the search engine recognises your tags correctly.
An example of the testing process could be:
- Submit your sitemaps with hreflang tags to Google Search Console
- Check warnings and errors under “International Targeting”
- Correct incorrectly paired or missing references
If you have a large e-commerce platform with many country pages, you can automate your hreflang tags. It saves time and reduces the risk of errors. At the same time, your language versions need to reflect cultural differences in the copy, design and images. This is where collaboration between content and design can give you a consistent experience.
What should you watch out for?
Hreflang seems simple. Even so, many errors occur because tags lack reciprocity or have incorrect codes. Follow the official ISO standards for language and region. Check regularly that all versions point correctly to each other. If a page doesn't link back with a hreflang link, Google typically ignores both references.
Hreflang doesn't replace traditional SEO either. It's a technical markup, and it needs to be backed up by optimised content, internal links and a correct structure. If you combine it with targeted SEM and locally angled content, you get correct display and a more solid presence in every market you operate in.