Web and SEO

Publish Reciprocal Hreflang for a Multilingual Page

·

Generate one set of hreflang annotations for the pages that offer equivalent content in different languages or regions. Start with the final canonical URL of each version. Choose HTML head tags or an XML sitemap according to where you manage the annotations.

Hreflang Tag Generator

Give all four workshop pages the same alternate set

Select Load workshop example to generate four lines. The US English repair page includes edition=2026&view=full as part of the address. The UK uses en-GB, Spanish uses es, and the language selector uses x-default.

Download hreflang-tags.html. The US URL contains & in the HTML attribute. An HTML parser reads it as an ampersand in the page URL. Check the other three attributes and keep exactly the same four links in the head of each page. On the Spanish page, the es line is its self-reference. On the UK page, the en-GB line is its self-reference.

Google Search Central guidance for localized page versions

Keep local sitemap entries with their origin

Choose XML sitemap. The example gives four <url> entries with four identical <xhtml:link> children inside each entry. Inspect each <loc> and confirm that it also appears among the alternates.

Change the UK address to https://workshop-uk.example/repair and generate again. The Sitemap origin control now offers two origins. The UK XML has one <loc> and the original origin has three. Both still list all four alternate links in every entry. Save each file for the appropriate site and host the sitemap where its listed locations fall within scope.

Google Search Central guidance for localized page versionsSitemaps XML protocol

Resolve conflicting rows before deploying the tags

Add a second EN-gb line with a different page URL. The generator reports the conflicting line and withholds export until you choose one destination. If the same label and URL were pasted twice, the warning identifies the extra line and the output uses a single copy.

After deployment, save the HTML head from the US and Spanish pages and compare them in Hreflang Validator. Check that the Spanish page points back to the exact US URL, including its query, and that both pages list their own addresses. Generated markup establishes the mapping you intend. Actual page responses and indexing require separate evidence.

Google Search Central guidance for localized page versions

Common questions

Should I publish both HTML and sitemap hreflang?

Choose the method you can keep correct across all versions. Google treats HTML tags, HTTP headers and sitemap annotations as equivalent ways to communicate alternates.

Why are en-GB and en different labels?

The first targets English readers in the United Kingdom. The second can target English readers without a specific regional choice.

Can two labels use the same destination?

Yes. For example, a generic English page can also serve as x-default. The sitemap uses one location entry for the shared URL and keeps both labels.

Does the generator open the URLs I enter?

It formats and checks the supplied mappings in your browser. Verify the actual canonical URLs, indexability and deployed return links separately.

Sources

Put it into practice.

Related guides