To fix a wrong hreflang result, rebuild one complete, synchronized alternate-link set and verify it on every equivalent localized page.
First determine what “wrong” means. The generated markup may contain an unsuitable locale, your templates may have installed different sets on different pages, or the selected search result may reflect signals beyond hreflang. These are different problems, and changing valid tags will not guarantee a particular search result.
Hreflang describes relationships among substantially equivalent localized pages. It does not translate content, detect a page’s language, or guarantee which page a search engine selects. If the generated HTML is valid but the live pages contain inconsistent tags, the deployment is the problem. If both the set and deployment pass verification, investigate broader result-selection issues rather than repeatedly regenerating the same block.

Identify what the generator actually produced
Compare the output against the original rows before publishing it. The table below separates common output symptoms from implementation and search-result symptoms.
| What you see | What it points to | Corrective action |
|---|---|---|
| Locale capitalization differs from your input | The generator canonicalizes locale casing, so en-us becomes en-US and zh-hant becomes zh-Hant. | Use the canonical output and check that the locale still matches the intended language, script, and region. |
| Two rows use the same locale in different casing | Duplicate locale values are rejected case-insensitively after normalization. | Keep one row for each locale and remove the duplicate target. |
| A URL row is rejected | The target may be relative, scheme-relative, contain credentials, or contain a fragment. | Enter a fully qualified HTTP or HTTPS URL that includes the host and no credentials or fragment. |
| The entire set fails to generate | Malformed input fails the whole set instead of silently producing partial output. | Correct the flagged row, ensure every line has exactly one separator, and regenerate. |
| The current page is missing from the block | The input inventory was incomplete, so the page has no self-reference. | Add the current page and every equivalent alternate to the same set. |
| Two live pages contain different blocks | Deployment drift, a template issue, or conflicting implementation copies. | Install the identical complete set on every alternate page. |
| The search result shows an unexpected locale | Hreflang may not be the deciding factor because search engines use many signals. | Verify the relationships and deployment first, then review content, audience targeting, and other result signals. |
Regenerate and verify the corrected set
- Inventory every equivalent localized page. Write one row per version in the format locale | fully qualified URL. Include the page currently being edited, every alternate, and a self-reference for each page when the complete set is installed. The generator requires at least two rows, including the current page, and supports up to 100 rows. Add x-default only when a genuine fallback exists.
- Check each locale against the intended audience. The first subtag must identify a language. An optional four-letter script and optional two-letter region can follow, as in en-US, zh-Hans, zh-Hant, and fr-CA. A country code cannot appear by itself in the first position. A generic language such as fr can be useful when several country-specific French versions exist. The tool checks tag shape and canonical casing, but it does not check the complete current language and country registries supported by a particular search engine. Verify each intended tag against current Google guidance for localized versions and the actual content audience.
- Validate every destination URL. Use a complete HTTP or HTTPS address, including the host. Relative and scheme-relative references are rejected, as are URLs containing credentials or fragments. The browser URL parser normalizes the address, so inspect the normalized target rather than expecting every character of the pasted URL to remain unchanged. Confirm separately that the destination is the intended live page. If a localized version has moved or redirected, update its row and every related member of the cluster.
- Generate one complete block. Use the Hreflang Generator to paste the reviewed rows. Keep exactly one literal vertical bar on each line, with one locale and one URL per row. If any row is malformed, the entire set fails instead of giving you a partial block that could silently omit a language or region.
- Inspect the returned elements. The result contains one rel=alternate element for every row, with canonical locale casing and HTML escaping for attribute-sensitive characters. It should include the current page as a self-reference. Duplicate normalized locales are rejected, so correct the source inventory rather than deleting an apparently similar row by guesswork.
- Install the identical block on every alternate page. Put the same complete set in the head of every localized version, including a row for that page itself. This tool produces HTML head elements. Do not also maintain conflicting hreflang sets in HTTP headers and XML sitemaps; select the implementation your publishing system can keep complete and synchronized.
- Test the deployed HTML. Check the delivered HTML for every locale, then crawl at least a sample from every language cluster and compare the sets mechanically. Confirm that each page includes itself, every alternate points back, and every target resolves to a useful 200 page. The generator cannot access remote pages or prove that reciprocal links exist after deployment.
Apply locale and x-default rules precisely
A valid locale shape does not automatically make the targeting appropriate. The tool accepts a two-letter language followed by an optional script and region, then canonicalizes the casing. This structural check catches malformed values such as a country code in the language position, but a neatly formatted tag can still be unsupported or unsuitable for the page. Review the language actually used by the content, the script used to write it, and the region the version is intended to serve.
The x-default token has a narrower purpose. It does not represent a language and does not mean that a random page should receive every unmatched visitor. It identifies a fallback for users whose language or region settings do not match another listed alternate. A country selector or generic landing page may be appropriate, but only when it is genuinely intended to serve those users. Include one x-default row in the set and omit it when there is no meaningful fallback.
Do not add x-default merely to make the output look more complete. A generic language version can sometimes provide a more useful fallback than an x-default page when several regional variants exist. The important point is that every row represents a deliberate relationship, not merely another URL added to satisfy a minimum count.
Keep the entire cluster synchronized
Every localized version must publish the same complete set, including its own URL and a return link to every alternate. A one-way declaration can be ignored because another site must not be able to claim your page as an alternate unilaterally. If one page carries two tags while its alternates carry a different list, the cluster is inconsistent even when every individual URL returns successfully.
Choose one implementation method that your publishing system can maintain. Google treats hreflang supplied in HTML, HTTP headers, and XML sitemaps as equivalent, but keeping several independent copies can allow them to drift apart. The generated HTML block is suitable for the head; do not combine it with a conflicting set elsewhere unless your system deliberately keeps every implementation synchronized.
When a locale is added, removed, redirected, or moved to a new canonical URL, update every member of that language cluster. Also check that the grouped pages remain substantially equivalent. Hreflang cannot replace translated primary content or compensate for a confusing international site architecture, and valid relationships do not justify including pages that serve materially different tasks or content.
Test the deployed HTML, not just the preview
The preview shown by a generator is not the final implementation. Your CMS, theme, CDN, or server layer may omit a tag, retain an old version, or add a conflicting copy. Check the page source delivered for each locale rather than relying on what the template appears to contain in an editor.
- Compare the locale and URL lists across the cluster and confirm that every page has the same complete set.
- Confirm that each page links to itself and that every listed alternate links back.
- Verify that each target resolves to the intended useful 200 page, not an unrelated destination or broken redirect.
- Look for stale tags left in page templates, HTTP headers, XML sitemaps, or reused content blocks.
- Confirm that the final URLs still match the pages included in the same equivalence cluster.
Mechanical set comparison is useful because it exposes small differences that are easy to overlook, such as one page retaining an old locale after another page receives a new tag. The output block alone cannot perform this remote verification, so the crawl remains a necessary part of correcting a result that appeared wrong after generation.
Separate a search-result issue from a tag issue
If the generated block is correct, every alternate returns the same set, and each page has valid self and reciprocal links, the remaining problem may lie outside hreflang. Google may algorithmically identify page language and choose results based on many signals. Hreflang does not force a specific page to appear for every matching query, so changing otherwise valid relationships merely to influence the visible result is not a dependable fix.
Review the live content, translation quality, intended audience, redirects, and current search documentation. If a page no longer serves substantially equivalent content, remove it from the cluster rather than preserving an inaccurate tag relationship. The defensible outcome is a synchronized set that accurately describes the localized pages, not a promise about every future search result.
For a deeper look, see How Do I Generate Hreflang for a Complete Page Set?.
For a deeper look, see How Do I Get Started When I Need to Generate Hreflang?.