Imagine you run an online store that sells to customers in both the United States and the United Kingdom. You have separate product pages for each market. The US page displays prices in dollars, while the UK page uses pounds and explains local shipping options.
Everything looks fine to visitors. But there’s a problem: someone searching from London occasionally lands on the American page.
This is one of the situations where hreflang can help.
Hreflang gives Google information about the language and regional versions of your pages, helping it choose a suitable version for the person searching. The concept is straightforward, although the implementation can become confusing when you’re dealing with several languages, countries, or domains.
Here’s how to get it right without making the process unnecessarily complicated.
What Does Hreflang Actually Do?
Hreflang is an annotation that connects equivalent pages written for different languages or regions.
Let’s say your website has these two URLs:
https://example.com/us/shipping/https://example.com/uk/shipping/
Both explain your shipping policy, but the details are tailored to different countries.
By adding hreflang annotations, you’re telling Google that these pages are alternatives intended for different audiences.
For example:
<link rel="alternate" hreflang="en-US" href="https://example.com/us/shipping/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/shipping/" />
The en-US value represents English for the United States, while en-GB represents English for the United Kingdom.
Notice that the UK code is GB, not UK. It’s a small detail, but an important one. Incorrect region codes can cause Google to disregard the intended regional targeting.
It’s also worth understanding what hreflang doesn’t do. It won’t translate your content, automatically redirect visitors, or push your website higher in search results simply because the tags exist.
Its job is to describe the relationship between localized pages.
When Do You Actually Need Hreflang?
Not every website needs it.
If your business has one English website serving customers worldwide, adding en-US to every page doesn’t automatically make it more relevant to American searchers.
Hreflang becomes useful when you maintain separate versions of the same content.
A few common examples include:
- An eCommerce business with different prices and delivery information for US and UK customers.
- A travel website publishing English, French, and German versions of destination guides.
- A software company offering localized product documentation.
- A business with separate landing pages for different countries.
The key phrase here is equivalent content.
A German product page should correspond to the same product in English. You shouldn’t connect an English homepage to an unrelated French service page just because both belong to the same website.
How to Generate Hreflang Tags Without Writing the Code Yourself
Writing two hreflang tags manually isn’t difficult. The trouble starts when your website has five, ten, or twenty language versions.
Every participating page needs the correct references, including a reference to itself. One missing URL or outdated destination can create problems across the group.
That’s why a generator can be useful.
The Free Hreflang Tag Generator from Degates lets you prepare language annotations by entering the URLs and their corresponding language codes.
Here’s a practical example.
Start with the pages you want to connect
Suppose you’ve published the same product information for three markets:
| Market | Language Code | Page URL |
|---|---|---|
| United States | en-US | https://example.com/us/product/ |
| United Kingdom | en-GB | https://example.com/uk/product/ |
| Germany | de-DE | https://example.com/de/product/ |
Before generating anything, open each page and confirm that it exists and contains the intended localized content.
This sounds obvious, but it’s easy to overlook after a website migration or a bulk content upload.
Enter your URLs into the generator
Open the Degates Hreflang Tag Generator and add the language code and complete URL for each version.
Include the page you’re currently working on. A page should reference itself as well as its alternatives.
The tool also provides a CSV import option, which can save time if you’ve already organized your localized URLs in a spreadsheet.
Generate the markup
After entering your URLs, complete the verification check and generate the code.
For the example above, the HTML output would look like this:
<link rel="alternate" hreflang="en-US" href="https://example.com/us/product/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/product/" />
<link rel="alternate" hreflang="de-DE" href="https://example.com/de/product/" />
The important part isn’t the order of the tags. It’s that each participating page includes the correct set of alternate URLs.
Add the code to the right place
For an HTML implementation, these tags belong in the <head> section of the page.
You should use the same complete set on the US, UK, and German versions.
Don’t paste the code into the visible content of a WordPress post. Visitors might see the markup as text, but Google won’t treat it as properly implemented head annotations.
Once you’ve published the changes, inspect the rendered page source to confirm the tags appear where they should.
The Mistake That Often Gets Overlooked: Return Links
Let’s return to the US and UK shipping pages.
Suppose the American page contains a hreflang tag pointing to the British page. But the British page doesn’t point back.
That relationship is incomplete.
Google expects bidirectional annotations between alternate pages. If the pages don’t reference each other, Google may ignore the relationship.
For a small website, checking this manually is manageable. For a multilingual store with hundreds of product pages, it becomes a maintenance task.
A sensible approach is to keep your language mappings in one place, whether that’s a multilingual plugin, a spreadsheet, or your content management system.
That way, when a URL changes, you’re less likely to update one language version and forget the others.
What About x-default?
Here’s another common situation.
Your website supports English, German, and French, but a visitor searches in a language you haven’t translated.
Where should that visitor go?
You might have a general landing page that lets people choose their country or language.
Hreflang supports an optional value called x-default for this purpose.
For example:
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/choose-language/" />
The fallback doesn’t have to be a language selector. It can also be a suitable general version of the content.
You don’t need to create a new page simply to use x-default. If you don’t have an appropriate fallback, you can leave it out.
Should You Use HTML Tags or an XML Sitemap?
There are three supported ways to communicate hreflang relationships to Google:
HTML annotations are a practical choice when you control the page head, either through your website’s theme or an SEO integration.
XML sitemap annotations can be easier to manage when a website has many localized pages and a centralized sitemap system.
HTTP Link headers are especially useful for non-HTML resources, such as translated PDF documents.
Google treats these as equivalent implementation methods. You don’t gain an additional search advantage by using all three.
For most website owners, the best choice is the one they can maintain consistently.
If you’re using WordPress with a multilingual plugin, check its settings before adding anything manually. Your plugin may already be generating hreflang annotations.
Duplicating the same information through several plugins or templates can make troubleshooting harder.
Hreflang and Canonical Tags Are Not the Same Thing
This is where international SEO can get tricky.
A canonical tag tells search engines which URL you prefer among duplicate or closely similar pages.
Hreflang identifies alternative versions intended for different languages or regions.
Imagine you have a properly translated English page and a German page. If both are meant to appear in search results, they would generally have their own appropriate canonical URLs, with hreflang connecting them.
Pointing the German page’s canonical tag to the English version can work against your goal of having both language versions indexed.
There are more complicated cases, particularly when regional pages use the same language and contain nearly identical content. Those require a deliberate canonical strategy rather than a blanket rule.
If you’re preparing canonical markup separately, the Degates Canonical URL Generator can help format the tag.
Five Checks Worth Making Before You Publish
A generator can produce correctly formatted code, but it can’t make a broken localization strategy work.
Before adding hreflang to a live website, check the following:
Are the pages genuinely equivalent? A US product page should connect to the corresponding UK product page, not a different product or category.
Are the URLs final? Avoid using old URLs that redirect elsewhere. Use the intended destination whenever possible.
Do the pages reference one another? Check the return links, not just the annotations on your main page.
Are the language codes correct? Use en-GB for UK English, not en-UK, and don’t use a country code without a language.
Can Google access the pages? Review crawlability, indexing directives, and canonical tags. Hreflang won’t override those settings.
If you’re managing dozens of pages, make these checks part of your publishing process rather than something you do only after rankings become a concern.
Can Hreflang Improve Your SEO Results?
It can help Google select a more appropriate localized result, which may improve the experience for people searching from different regions.
But there’s an important distinction between showing the right page and ranking higher.
Hreflang isn’t a shortcut to the first page of Google.
If your UK page has weak content, poor internal linking, or technical indexing problems, adding hreflang won’t solve those issues.
Think of it as one piece of a broader international SEO setup. It works alongside useful localized content, a sensible site structure, appropriate canonical tags, and accessible pages.
Final Thoughts
Hreflang is easier to understand when you stop thinking about it as a collection of technical tags and start thinking about the problem it solves.
You have several versions of a page. Each one serves a different audience. You want Google to understand how those versions relate to each other.
That’s the purpose of hreflang.
Start with accurate URL mappings, generate the annotations, implement them through one reliable method, and check the live output afterward.
If you’d rather avoid writing the markup manually, try the Free Hreflang Tag Generator. It supports HTML, XML sitemap, and HTTP Link header output, along with features for organizing multiple localized URLs.
The tool can save you time. Getting the underlying page relationships right is still the part that matters most.
Leave a Reply