How to Use Hreflang Tags for International SEO
To use hreflang tags for international SEO, give each language or country version of a page its own URL, then add a set of annotations that lists every version, including the page itself, with a language code and an optional country code. You can place that set in the HTML head, in an HTTP header or in your XML sitemap, and Google treats the three as equivalent. Every version must carry the same set so that each one points back to the others, and an x-default entry can name a fallback page. Then check the result, because a broken set fails quietly.

The steps below follow Google’s own documentation and use one Canadian example all the way through, so you can see how the same set looks in each format. If you are still deciding what hreflang is and whether your site needs it, start there, since a single-language site aimed at one country has nothing to annotate. This page assumes you already have, or are about to publish, at least two versions of the same content.
Step 1: Map every version of the page
Hreflang describes a group of pages, so the work starts with a list rather than a tag. For each piece of content, write down every URL that serves the same content to a different language or country, and note who each version is for. Google says alternate URLs do not need to sit on the same domain, so a .ca site and a .com site can belong to one set. Choosing between those structures (country domains, subdomains or subfolders) is a bigger decision that the wider guide to international SEO covers; hreflang works with any of them.
Here is the illustrative set used in the rest of this guide: a Calgary business with an English page for Canada, a French page for Canada and an English page for the United States, plus a page where visitors choose their country.
| Version | Audience | URL (illustrative) | Code |
|---|---|---|---|
| English, Canada | English speakers in Canada | https://example.ca/en/services/ | en-CA |
| French, Canada | French speakers in Canada | https://example.ca/fr/services/ | fr-CA |
| English, United States | English speakers in the US | https://example.com/services/ | en-US |
| Country selector | Everyone else | https://example.ca/ | x-default |
Every row in that table needs a real, separate URL that returns the page without a redirect. Google’s multi-regional guidance asks for different URLs for different language versions and warns against redirecting visitors automatically based on what you guess their language or location to be, partly because Googlebot usually crawls from the United States without stating a language preference. A site that swaps the language on one URL through cookies or IP detection gives hreflang nothing to point at.
Step 2: Choose valid language and region codes
Each hreflang value is a language code in ISO 639-1 format, optionally followed by a dash and a region code in ISO 3166-1 Alpha 2 format. The language always comes first, and Google states that you cannot specify a country by itself, because it does not derive a language from a country code. Case does not matter to Google, although writing the region in capitals (en-CA rather than en-ca) follows the ISO convention and makes the list easier to read.

A few codes cause most of the trouble. The United Kingdom is GB, so en-UK is wrong, and Google lists UK, EU and UN as reserved codes that have no effect in Search. Google also says codes outside those two standards, such as es-419 for Latin American Spanish, are not supported, even though some guides still recommend them. Regions mean country and territory codes only, so there is no code for Alberta, Quebec or Calgary, and hreflang cannot separate a Calgary page from an Edmonton page in the same language.
For a Canadian site, the useful decision is usually between fr and fr-CA. Use fr-CA when the page is written for Canadian readers, with Canadian prices, shipping or regulations, and use plain fr when one French page is meant for French speakers anywhere. Google also suggests a general version for a language when you run several country versions of it, so in the example a searcher in Britain or Australia would otherwise have no English match; the x-default entry in step 5 covers that gap here, or you could add a fifth line, hreflang=”en”, pointing at one of the English pages.
Step 3: Pick one place to put the annotations
Google documents three methods and says they are equivalent from its perspective. You can combine them, but Google notes that there is no benefit in Search and three implementations are much harder to manage than one, so choose the one your site can keep accurate.
| Method | Best fit | What to watch |
|---|---|---|
| HTML link elements in the head | Most sites, especially when a CMS or multilingual plugin writes the head | The links must sit inside a well-formed head, and a plugin conflict can drop them |
| HTTP Link header | Non-HTML files such as PDFs | Needs server or CDN configuration, so it is hard to see without tools |
| XML sitemap | Large sites, or sites where the head is hard to edit | Each URL entry lists every version, and the sitemap must stay current |
In the HTML method, the same block goes in the head of all four pages, including the country selector, and each copy includes a line for the page itself:
<link rel="alternate" hreflang="en-CA" href="https://example.ca/en/services/" />
<link rel="alternate" hreflang="fr-CA" href="https://example.ca/fr/services/" />
<link rel="alternate" hreflang="en-US" href="https://example.com/services/" />
<link rel="alternate" hreflang="x-default" href="https://example.ca/" />
In a sitemap, each version gets its own url entry, and every entry carries the same child links. The sitemap must declare the xhtml namespace, and the order of the child elements does not matter, although keeping them in the same order makes mistakes easier to spot:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://example.ca/en/services/</loc>
<xhtml:link rel="alternate" hreflang="en-CA" href="https://example.ca/en/services/"/>
<xhtml:link rel="alternate" hreflang="fr-CA" href="https://example.ca/fr/services/"/>
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/services/"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.ca/"/>
</url>
<!-- repeat the same four xhtml:link lines inside a url entry for each of the other three pages -->
</urlset>
A sitemap can only list URLs under the location it is hosted from, so the url entry for https://example.com/services/ belongs in example.com’s own sitemap (the xhtml:link lines inside each entry can still point to the other domain).
For a PDF, the server returns the same information in a header, again identical for every version:
Link: <https://example.ca/en/guide.pdf>; rel="alternate"; hreflang="en-CA", <https://example.ca/fr/guide.pdf>; rel="alternate"; hreflang="fr-CA"
Whichever method you choose, every URL must be fully qualified, including https, so a relative path such as /fr/services/ is not acceptable.
Step 4: Make every version point back

Return links are where most implementations break. Google states that if two pages do not both point to each other, the tags are ignored, and it explains why: otherwise someone on another site could name their page as an alternate version of yours. That is why the set in step 3 is identical on every page. When the French page lists the English one but the English page does not list the French one, that pair does nothing, and no error appears on the page to tell you.
Google’s documentation adds a point that many guides miss. If a complete set of two-way links becomes hard to maintain, you can leave some languages off some pages, and Google will still process the pairs that do point to each other. It also says the priority is to link newly added language versions both ways with the original or dominant version of the site. In the example, that means a new en-US page should be paired with the en-CA page before anything else, which is a practical order of work when a site grows one market at a time.

The maintenance cost follows from this rule. Adding a fourth version means changing the annotations on the three pages that already exist, as well as writing them on the new one, so the list belongs in one place that generates the markup for every member at once. On WordPress that is usually the multilingual plugin’s record of which pages are translations of each other; on a custom site it might be a table that builds the sitemap. Hand-editing each page’s head works for one pair and tends to drift once there are more.
Step 5: Add an x-default fallback
The reserved value x-default tells Google which page to show when a searcher’s language settings match none of your versions. Google recommends it and says it was designed for language or country selector pages, which is why the example points it at the home page with a country choice. It is not a language and needs no code of its own. If you have no selector, point x-default at the version that suits an unmatched visitor best, which for most Canadian businesses is the English page.
Step 6: Line hreflang up with canonicals and indexing
Hreflang and rel=”canonical” do different jobs, and they need to agree. Each version should have a canonical that points to itself, or at least to a page in the same language, and the URL in its canonical should be exactly the URL listed in the hreflang set. Google’s canonicalization guidance says that when you use hreflang, the canonical should be in the same language, or the best substitute language if no same-language page exists. Pointing the French page’s canonical at the English page asks Google to fold the French version into the English one, which works against the whole set.

The same document notes that, for canonicalization, Google prefers URLs that are part of hreflang clusters. That matters where two versions share a language and differ only in details, such as the en-CA and en-US pages above, because a version left out of the cluster is the one less likely to be chosen as canonical. By the same logic, every URL in the set should return a 200 status, should not be blocked by robots.txt or carry a noindex, and should be the https version, so that you never ask Google to swap a searcher onto a page it cannot show.
Step 7: Check the set, and keep checking it
Google no longer offers a hreflang report. The International Targeting report in Search Console has been deprecated, and its help page says Google will continue to support and use hreflang tags but no longer supports country targeting through Search Console. Some guides still tell you to set a target country there, so ignore that step if you see it.
That leaves three practical checks. View the source of each version, search for hreflang, and confirm the lines are identical and inside the head. Run a crawler across the set to catch missing return links, non-200 targets, wrong codes and canonical conflicts, which is part of any technical SEO audit of a multilingual site. For single pages, Google’s own documentation points to Aleyda Solis’s hreflang tags generator and the Merkle SEO hreflang testing tool, with the caution that Google does not maintain or check either.
Repeat the check whenever a page is added, moved or deleted in any language. A set that was correct at launch can lose a return link the first time someone publishes a translation without updating the others, and nothing on the page will show it.
What hreflang will not do

Hreflang helps Google show the right version of a page to the right searcher; it does not make any version rank. Google describes it as a way to help Search point users to the most appropriate version by language or region. In practice, a version that would not have ranked on its own merits will not start ranking because it is annotated. Google also says it does not use hreflang or the HTML lang attribute to detect a page’s language, because it reads the visible content instead, so each page should use one language for its content and navigation. A French page produced by unedited machine translation is still a weak French page, however carefully it is tagged.
When to ask for help

SEO Company To-The-TOP! has worked on search engine optimization in Calgary since 2007, and hreflang is the kind of item a website audit checks on a bilingual or cross-border site: whether every version exists, points back and agrees with its canonical. To-The-TOP! is a solo practice, so the person who reviews the site is the person who does the work, with White Hat methods only. Organic results in a new language or country take months to build, so plan the rollout with that in mind.
If you are opening a new market in the meantime, a Google Ads campaign can target Canadian and American searchers separately while the organic versions are indexed. To talk through an hreflang setup or a site in more than one language, call SEO Company To-The-TOP! at (403) 308-5949.
Contact Calgary SEO Company To-The-TOP!
Questions about anything in this article, or about your own rankings? Talk to a Calgary SEO specialist directly.
Phone: (403) 308-5949
Address: 1509 14 Ave SW, Calgary, AB T3C 0W4
Hours:
Monday to Friday: 10:00 am – 7:00 pm
Saturday: 12:00 pm – 4:00 pm
Sunday: closed
