You need to generate hreflang when the same content is published on separate, indexable URLs for different language or regional audiences and you want those pages recognized as equivalent alternatives.

The decision is cluster-based rather than site-based. A large site may have hundreds of international pages but only a few groups of equivalent content that need hreflang. Conversely, even a small site needs it when one article, product, or landing page has translated or regional versions on different URLs.

how do i decide whether i need to generate hreflang
How Do I Decide Whether to Generate Hreflang?

When hreflang is the right choice

Before generating tags, check whether each candidate URL represents substantially the same content and serves a defined language or market. The strongest candidates are pages with the same core purpose, such as an English product page and its French translation, or an international offer with separate versions for the United States and Canada.

  • Translated equivalents: The same article, product, category, or landing page exists on separate URLs in different languages.
  • Regional equivalents: A shared page has versions tailored to individual countries, even when the language remains the same.
  • Script-specific equivalents: Content is available in variants such as Simplified and Traditional Chinese, with each version intended for the appropriate reading system.
  • Distinct URLs and intent: Each version has a stable, crawlable address and addresses essentially the same search need as the others.

Google’s localized versions guidance explains hreflang as a way to identify alternate language and regional versions of a page. The annotation belongs on the equivalent-page cluster, not automatically on every page that happens to use another language.

Site situationNeed hreflang?Decision
One language and one marketNoThere is no alternate cluster to annotate.
The same article in separate English and French URLsYesCreate one cluster containing every equivalent translation.
The same offer in en-US and en-GB versionsOftenUse language and region codes when the pages target different markets.
Country-specific French pages plus a generic French pageOftenInclude the generic page when it is a genuine equivalent and useful fallback.
Different pages cover different topics or search intentUsually noDo not force unrelated pages into the same alternate set.
The URL changes according to a visitor’s cookie or locationNot this workflowHreflang needs identifiable alternate URLs, so use stable, indexable page addresses.

A useful question is: “Would someone searching in the target locale expect this URL to be the same destination and satisfy the same core need?” If the answer is yes and the URLs represent equivalent content, hreflang is appropriate. If the page solves a different local problem or serves a separate stage of the customer journey, treat it as its own content cluster.

Choose language, region, and fallback values

Each row in an hreflang set needs a locale value that reflects the page’s actual content and intended audience. Use a two-letter language code first, followed by an optional four-letter script and optional two-letter region. A country code cannot stand alone because the first subtag identifies the language.

LocaleMeaningAppropriate use
enGeneric EnglishOne English version serves all relevant English audiences.
en-USEnglish for the United StatesThe page specifically targets United States users.
fr-CAFrench for CanadaThe page provides Canadian French content or market targeting.
zh-HantTraditional ChineseThe writing system distinguishes the intended version.
x-defaultFallback for unmatched settingsA genuine selector or generic landing page covers users whose settings do not match another listed alternate.

A generic language such as fr can be useful when several country-specific French versions exist. The x-default token is optional and is not itself a language. Add it only when a real fallback page exists, and include no more than one x-default row in a set.

Separate hreflang from other SEO tasks

Hreflang describes relationships among existing localized pages; it does not perform several related tasks:

  • Translation: It cannot translate or localize copy. Each page still needs useful content written or adapted for its audience.
  • Language detection: Google may algorithmically identify a page’s language and choose results using many signals. Hreflang supplements that process rather than detecting language itself.
  • Result selection: Correct annotations establish alternate relationships but do not guarantee that a particular page will appear for a query.
  • International site architecture: The tags are not a substitute for coherent URL structures, stable canonical URLs, or a sound localization strategy.

Canonical tags and hreflang solve different problems. A canonical tag identifies the preferred URL for a duplicate or near-duplicate resource, while hreflang identifies substantially equivalent pages across languages or regions. Decide the correct canonical URL for each version before building the alternate set.

Decide and prepare the hreflang set

Once the inventory confirms that a cluster needs hreflang, build the set from the complete page cluster rather than from an isolated page.

  1. Inventory every localized page. List each equivalent page as a locale followed by one fully qualified URL. Include the page currently being edited, because every page in the cluster needs a self-reference.
  2. Confirm equivalence and audience fit. Remove pages that serve a different intent, and verify that every retained URL has useful content for the language or region named in its row.
  3. Assign the locale values. Choose a language code first, then add script or region only when it reflects a real distinction. Check canonical casing: en-us becomes en-US, and zh-hant becomes zh-Hant.
  4. Decide whether x-default belongs. Add it only for a genuine unmatched-user fallback. A country selector or generic landing page may qualify, but an arbitrary extra row does not.
  5. Prepare valid input rows. Put exactly one literal vertical bar between each locale and URL. Use absolute HTTP or HTTPS URLs containing the host; relative and scheme-relative references are rejected. Credentials and fragments are also rejected, and duplicate locale values are rejected after case normalization.
  6. Generate the complete block. Paste the reviewed rows into the Hreflang Generator. It produces one escaped HTML alternate link per row and canonicalizes supported locale casing. The tool accepts at least two rows, including the current page, and up to 100 rows. A malformed input fails the entire set instead of returning a partial block that could silently omit a locale.
  7. Check the output against current guidance. Confirm each intended language, script, and region against current search-engine documentation and the real content audience. The generator validates a conservative tag shape, but it does not check every current language or country registry or prove that a locale is appropriate. The HTML output follows the format described in the WHATWG alternate-link guidance.
  8. Install the same set everywhere. Place the identical set in the head of every page in the language cluster, including the current page and all alternates. The tool creates HTML head elements; it does not create HTTP-header or XML-sitemap implementations.

Verify the deployed relationships

Generated code is only the starting point. Use a live crawl or equivalent inspection process to review the delivered pages; this confirmation checklist for deployed hreflang tags provides a focused verification workflow.

  • Every page in the cluster contains the same complete set of locale-and-URL pairs.
  • Each page includes its own URL as a self-reference.
  • Every alternate points back to the other pages in the set, creating reciprocal relationships.
  • Each referenced URL resolves to a useful page with a successful 200 response.
  • Each locale and destination still matches the page’s content and intended audience.
  • The cluster contains no duplicate locale values and no more than one x-default row.

Reciprocity matters because search engines can ignore a one-way alternate declaration. Another site should not be able to claim your page as an alternate unilaterally, so both pages in a relationship need to participate. The generator cannot access remote pages or prove that the installed links are reciprocal, making post-deployment crawling part of the publishing process rather than an optional extra.

Also choose one implementation method that your publishing system can keep synchronized. HTML head elements, HTTP headers, and XML sitemaps are alternative methods for declaring the same relationships. Maintaining inconsistent copies across several methods can introduce conflicting sets, so the HTML generated for this workflow should not be mixed with separate hreflang implementations unless they are deliberately kept identical.

Keep the decision current

Your need for hreflang changes with the content architecture. Add annotations when a new equivalent locale is published, and remove or update them when a version is removed, redirected, or moved to a new canonical URL. A change to one member of a cluster requires the complete set to be regenerated and redistributed to every other member.

Periodically crawl at least one page from each language cluster and compare the deployed sets mechanically. Also reassess whether the pages remain substantially equivalent. A page that has developed a different purpose may no longer belong in the cluster even if its URL and locale are still valid. The practical rule remains simple: generate hreflang for stable, equivalent language and region URLs; avoid it for unrelated pages or as a substitute for translation and sound international architecture.

Related reading: How Do I Document the Steps I Use to Generate Hreflang?.