Menu

Hreflang Tags: Mastering Folders, Subdomains, ccTLDs & Implementation

Neeraj Kumar
Written by Neeraj Kumar
6 min read
September 24, 2026

When expanding a website internationally, search engines need exact instructions on which language or regional version of a page to serve to a specific user. The hreflang attribute provides this signal, but how you implement it depends heavily on your site's architecture.

Here is a breakdown of how to handle hreflang tags across subfolders, subdomains, and ccTLDs, along with the most frequent errors and persistent myths that derail international SEO campaigns.

URL Architecture and Hreflang Strategy

The way your domain is structured dictates how link equity flows and how easily you can manage your hreflang mapping.

Architecture TypeExample URLSEO ImpactHreflang Implementation Note
Subfoldersexample.com/fr/Pools link equity on the root domain.Simplest to map. All tags exist under one root domain, easily managed via a single XML sitemap.
Subdomainsfr.example.comSplits link equity; search engines treat them as somewhat separate entities.Good for separating CMS platforms, but requires exact cross-domain mapping in the <head> or separate sitemaps.
ccTLDsexample.frUnbeatable local trust and geolocation signals.Highest maintenance. Hreflang must cross entirely different domains, requiring absolute precision with absolute URLs.
Comparison of subfolders, subdomains and country-code TLDs (ccTLDs) for international SEO, with hreflang code examples and pros and cons of each

For most businesses, subfolders are the recommended route because they consolidate domain authority and simplify technical management. Subdomains and ccTLDs require treating each regional variation as a separate website that needs its own backlink profile.

The Ideal Implementation Example

Regardless of your architecture, a flawless hreflang implementation must contain absolute URLs, correct ISO codes, and a fallback page.

If you have an English site targeting the US, an English site targeting the UK, a French site targeting France, and a default global page, the ideal implementation in the <head> section of every single one of these pages looks like this:

html

Key rules applied here:

  • Self-referencing: The US page must include the link to itself.
  • Bidirectional (Return) Links: If the US page points to the French page, the French page must point back to the US page.
  • Absolute URLs: Every link includes https:// and the full domain path.
Hreflang return links and self-referencing tags between English (US), English (UK) and French (FR) versions of a website

Common Hreflang Errors

Even minor syntax mistakes will cause search engines to ignore your entire hreflang cluster.

  • Invalid Region and Language Codes: You must use ISO 639-1 for languages and ISO 3166-1 Alpha 2 for countries. A classic error is using en-uk for the UK instead of the correct en-gb, or using kr (Kiribati) instead of ko-KR for South Korea.
  • Missing Return Links: If Page A points to Page B, but Page B does not point back to Page A, the relationship is broken and the tag is ignored.
  • Missing Self-Referencing Tags: A page must list its own hreflang tag alongside its alternates. Leaving this out is the most common reason for parsing errors in Google Search Console.
  • Canonical Tag Conflicts: Hreflang and canonical tags serve different purposes. If example.com/fr/ has a canonical tag pointing back to the English homepage example.com/, Google gets conflicting instructions. Each localized page should have a self-referencing canonical tag, handled properly alongside your standard on-page SEO strategies.
  • Punctuation and Case Mistakes: Using an underscore (en_US) instead of a hyphen (en-US) breaks the tag. While the case doesn't technically break the code (it's case-insensitive), best practice is lowercase for language and uppercase for country (en-US).
  • Linking to Broken or Redirecting URLs: Hreflang tags must point directly to a page returning a 200 OK status code. Pointing to 301 redirects or 404 pages forces search engine crawlers to waste crawl budget and eventually drop the cluster.

Persistent Hreflang Myths

Reality: Hreflang is a matching signal, not a ranking factor. It does not pass PageRank like a standard <a href> link. However, if your US page ranks highly, hreflang allows Google to swap out the US URL for the localized UK URL in UK search results, effectively sharing the ranking power.

Myth: You can target specific cities with hreflang.

Reality: The protocol only supports language and country codes. You cannot target en-London or en-NYC.

Myth: Hreflang acts as a strict directive.

Reality: It is only a hint. If Google determines that a different page is vastly more relevant to a user, or if your local page has thin content, it may ignore your hreflang setup entirely and serve a different URL.

Myth: You need a tag for every country in the world.

Reality: You only need to tag the specific markets you actively target. For the rest of the world, a single x-default tag acts as the catch-all.

Alternative Implementation Methods

While placing tags in the HTML head is the most common approach, it becomes a liability for massive e-commerce sites or publishers. Adding dozens of link elements to every page inflates the code, slows down rendering, and creates a messy maintenance process. You have two other options.

1. XML Sitemaps

Sitemaps keep your HTML clean and allow you to update your localization mapping in one centralized file. This is highly recommended for sites using subdomains or ccTLDs where editing the header of every individual property is difficult.

The syntax requires specifying the main URL in the <loc> tag and listing every variation, including the URL itself, as an <xhtml:link> child element. Validate this mapping as part of your regular technical SEO audits.

xml

You must repeat this exact block for every URL variation. If you have three localized versions of a page, your sitemap will contain three <url> blocks, each containing three <xhtml:link> definitions.

2. HTTP Headers

This method is specifically designed for non-HTML files like PDFs. If you publish a whitepaper in English, Spanish, and German, you cannot insert HTML tags into a PDF document. Instead, you configure the server to return the hreflang data in the HTTP header response.

text

The IP Redirect Trap

One of the fastest ways to destroy an international SEO campaign is combining hreflang tags with automatic IP-based redirects.

Many developers attempt to be helpful by detecting a user's location and forcing them to the local version of the site. The problem is that Googlebot primarily crawls the web from IP addresses located in the United States. If your server automatically redirects all US traffic to example.com/us/, Googlebot will never be able to access your UK, French, or German pages. If the crawler cannot reach the pages, it cannot read the tags, and those regional pages will drop out of the search index.

Automatic IP-based redirects block Googlebot from regional pages, while a non-intrusive location banner keeps all hreflang versions crawlable

Instead of forcing a redirect, use a non-intrusive banner or pop-up suggesting the localized version based on the user's IP. This keeps all URLs accessible to search engine crawlers while still guiding human visitors to the right place.

Auditing Your Setup

Implementation is only half the job. Websites evolve, pages get deleted, and URLs change, which means your international mapping will eventually break if left unmonitored.

  • Crawl Before You Publish: Run your staging site through a crawler like Screaming Frog SEO Spider. The tool has a dedicated hreflang tab that immediately flags missing return links, invalid language codes, and broken URLs before they go live.
  • Monitor Google Search Console: Once live, keep a close eye on the GSC indexing reports. Google will flag issues if it detects conflicts between canonical tags and your localized URLs.
  • Verify Content Uniqueness: Search engines expect the content on localized pages to actually match the declared language. If you use hreflang to map an en-us page to an fr-fr page, but the French page is just a duplicate of the English text, Google will ignore the tag and treat it as a duplicate content anomaly, leading to issues similar to content cannibalization.

Getting international SEO right requires treating every localized URL as a distinct asset. When the architecture, canonicals, and mapping align perfectly, search engines will consistently connect your target audience with the exact page built specifically for them.

Frequently Asked Questions