A generated hreflang problem can be isolated by checking four layers in order: source rows, generated tags, deployed page heads, and live URLs; fix the first layer that fails.

Most failures fit into four categories: malformed locale-and-URL rows, tags that are structurally valid but unsuitable for the intended audience, deployment drift between alternate pages, or URLs that no longer deliver useful pages. The Hreflang Generator can validate row structure, normalize locale casing, reject duplicate locale values, and produce escaped HTML link elements. It cannot inspect remote pages, establish that localized content is substantially equivalent, or prove that deployed pages link back to one another.

how do i troubleshoot a problem when i generate hreflang
How to Troubleshoot a Problem When Generating Hreflang

Find the layer where hreflang stops working

Reproduce the problem with the exact list you intend to publish. Then determine whether the evidence breaks before generation, in the output, during installation, or after deployment.

Layer Evidence to check Corrective action
Source rows Exactly one separator per line, valid locale shape, fully qualified HTTP(S) URLs, 2 to 100 rows, and the current page included. Correct every malformed row and rerun the complete set. The tool does not return a partial set with one locale silently omitted.
Generated output One rel="alternate" element per row, canonical locale casing, escaped attributes, and no duplicate normalized locale. Correct the source rows and regenerate instead of hand-editing isolated tags.
Installed pages The delivered head contains the same complete set on every localized page, including a self-reference. Repair template or deployment drift and publish the identical block everywhere.
Live URLs Each alternate serves a useful 200 page and returns to the other alternates. Replace stale URLs, restore missing links, and crawl the cluster again.

Use the earliest failing layer to narrow the cause. For example, if the generator accepts the rows but one deployed page lacks a return link, changing locale casing cannot repair it; the deployed set must be corrected.

Correct the locale-and-URL source rows

Rebuild the input list from the pages that belong in the same language cluster. The generator treats the list as a complete unit, so one invalid entry can prevent the entire set from being copied.

  • Use the exact row structure. Enter one locale and one fully qualified URL per line, separated by one literal vertical bar. The tool requires at least two rows, including the current page, and supports up to 100. A malformed row fails the whole set so that a missing locale cannot be omitted unnoticed.
  • Check the locale shape. A locale contains a two-letter language, an optional four-letter script, and an optional two-letter region. A country code cannot stand alone, so use a form such as fr-CA rather than CA-fr. Casing is canonicalized: en-us becomes en-US, and zh-hant becomes zh-Hant.
  • Remove normalized duplicates. Two values that become the same locale after normalization are rejected case-insensitively. Use only one x-default row. Duplicate rows with the same normalized locale are rejected; distinct regional targets such as fr-FR and fr-CA can both be legitimate.
  • Supply clean, absolute URLs. Every URL must include http:// or https:// and the host. Relative and scheme-relative references are rejected. Credentials and fragments are also rejected. The browser URL parser normalizes the address before the escaped link element is produced.
  • Use x-default only for a genuine fallback. It is not a language. It identifies a page intended for users whose language or region does not match another listed alternate, often a country selector or generic landing page. Do not add one merely to make the list look complete.

Run a generation-to-live troubleshooting pass

  1. Inventory the complete language cluster. List every localized page that serves substantially equivalent content, including the URL currently being edited. Do not generate only the alternate being viewed or a subset of the available locales.
  2. Prepare one row per page. Write each row as locale | fully qualified URL. Include the current page and at least one other row, stay within the 100-row limit, and add x-default only when a real fallback page exists.
  3. Run the complete list through the generator. If the set is rejected, correct the invalid row and rerun it. Do not work around the rejection by copying only the rows that appear to work, because that can leave the deployed cluster incomplete.
  4. Verify locale meaning and targeting. Check every locale against Google Search Central's localized versions guidance and the actual content audience. The tool checks language-tag shape, not the complete current language and country registries supported by a search engine. A generic fr page can be useful when several country-specific French versions exist, while subtags such as zh-Hans and zh-Hant distinguish writing systems.
  5. Inspect the complete generated block. Confirm that every input row has one rel="alternate" element, locale casing is canonical, href values contain the intended absolute URLs, and attribute-sensitive characters are escaped. Check that the current page has a self-link and that every intended alternate is represented.
  6. Install the identical set in every alternate head. This tool specifically produces HTML head elements. If hreflang is also published through HTTP headers or XML sitemaps, do not combine inconsistent sets across those methods. Google treats the implementation methods as equivalent, so multiple copies can drift. Choose the method your publishing system can keep complete and synchronized.
  7. Crawl the delivered pages. Crawl a sample from every language cluster, confirm that each alternate returns a useful 200 page, verify that each page includes itself, and check that alternate pages link back to one another. Compare the locale-to-URL mapping mechanically across the cluster. The generator cannot access remote pages or prove reciprocity.
  8. Fix and repeat at the first failing layer. If the source rows are wrong, correct them and regenerate the full set. If installation is inconsistent, repair the shared output and republish every page in the cluster. Then rerun the live crawl rather than accepting a tidy code block that has not been verified in place.

Match the symptom to the failed check

  • No usable output appears. Check the row count, separator count, locale shape, normalized duplicates, URL rules, and current-page inclusion. Because malformed input fails the entire set, an almost valid list still produces no partial result.
  • The locale casing differs from what you typed. The change is canonicalization, not an encoding fault. For example, en-us becomes en-US. If the canonical shape is correct but the language or region does not match the intended audience, generator validation cannot resolve that strategic mismatch.
  • A URL is rejected. Replace a path-only or scheme-relative reference with a complete HTTP(S) address containing the host. Remove any credentials or fragments rather than expecting the generator to ignore them.
  • The x-default row causes a problem. Keep only one x-default entry and ensure it points to a genuine unmatched-user fallback. It cannot stand in for a language, region, script, or translated page.
  • The generated code is correct, but a live page has no tags. Inspect the delivered head on every page in the cluster. If tags point only in one direction, reciprocal links are missing. Google documents self and return links as essential, and a one-way declaration can be ignored.
  • An alternate URL redirects, moves, or stops serving a useful page. Update the affected URL in the source list, regenerate the complete set, and redeploy it across every member of the cluster.

Separate valid markup from valid international SEO

Passing generation is a formatting checkpoint, not a complete international SEO validation. The generator does not confirm every currently supported language or region, and hreflang itself does not translate content, detect a page's language, or guarantee a search result.

  • Locale support: Verify the intended language, script, and region separately against current documentation and the audience for the page.
  • Content equivalence: Confirm that the listed pages contain substantially equivalent content in their respective languages. Hreflang describes relationships; it does not replace translated primary content.
  • Language identification: Do not assume a tag controls how a search engine identifies the language of a page.
  • Live delivery: Confirm useful responses, current URLs, self-references, and reciprocal links after deployment. A structurally valid generator output proves none of those remote conditions.

One-way declarations can be ignored because another site must not be able to claim your page as its alternate unilaterally. By contrast, a complete cluster in which every page lists every alternate, including itself, gives the relationship a consistent basis. Google may still choose results using many other signals, so valid hreflang should complement rather than replace sound translation and international site architecture.

Keep every cluster synchronized after changes

Keep one reviewed locale-and-URL list as the source for generation. Whenever you add or remove a locale, redirect an alternate, or move it to a new canonical URL, update every member of that cluster. A new version listed on only one page does not create the required complete set.

After each release, crawl a sample from every language cluster and compare the sets mechanically. Ongoing accuracy depends on updating all members together, publishing one synchronized implementation method, and repeating both the source-row and live-page checks after every cluster change.

For a deeper look, see Check an XML Sitemap After Generating It From a URL List.

For a deeper look, see Common Mistakes When Generating Hreflang Tags.