Boneyard Tools

Bulk Hreflang Tag Generator

Add one row per language or region with its page URL and get a ready-to-paste hreflang block for the whole set at once. Switch between HTML link tags, XML sitemap xhtml:link entries, and HTTP Link headers, and add an optional x-default with a single toggle.

How to generate bulk hreflang tags

  1. Add a row for each localized page with its language code (like en-US) and full URL.
  2. Pick an output format (HTML, XML sitemap, or HTTP header) and toggle x-default if you need a fallback.
  3. Copy or download the generated block and apply the same set to every page it lists.

Examples

HTML link tags for English and French

en-US: https://x.com/en, fr: https://x.com/fr
<link rel="alternate" hreflang="en-US" href="https://x.com/en" />
<link rel="alternate" hreflang="fr" href="https://x.com/fr" />

XML sitemap entries

en-US: https://x.com/en, fr: https://x.com/fr (format: xml-sitemap)
<xhtml:link rel="alternate" hreflang="en-US" href="https://x.com/en"/>
<xhtml:link rel="alternate" hreflang="fr" href="https://x.com/fr"/>

HTTP Link header

en-US: https://x.com/en (format: http-header)
Link: <https://x.com/en>; rel="alternate"; hreflang="en-US"

Frequently asked questions

What do hreflang annotations do?

They tell search engines which version of a page to serve for a given language and region. If the same content exists in several languages, hreflang links the versions so each is shown to the right audience instead of competing with one another.

Which output format should I use?

Use HTML link tags when you can edit each page's head. Use XML sitemap entries when you manage alternates centrally in a sitemap and do not want to touch every template. Use the HTTP Link header for non-HTML files like PDFs, or when a CDN or server adds headers for you. All three are equally valid to Google; pick whichever fits your setup.

What is the x-default value for?

x-default marks the page to show when no other language or region matches the user, such as a language selector or a global landing page. It is optional but recommended when you target several languages. Toggle it on and the tool appends an x-default entry using the URL you set, or the first URL in the list.

Do hreflang tags need to be reciprocal?

Yes. Every page in a set should list all the alternates, including a self-referencing entry pointing to itself. If page A points to page B but page B does not point back, search engines may ignore the annotations entirely. Because this tool builds the full block once, you can paste the same set onto every page.

What format should the language code use?

Use a two-letter ISO 639-1 language code such as en or de, optionally followed by a hyphen and a two-letter ISO 3166-1 region code such as en-US or pt-BR. The tool flags codes that do not match that loose pattern so typos like en_US or english are caught early.

Is my input sent to a server?

No. The hreflang block is built entirely in your browser with JavaScript, so the languages and URLs you enter are never uploaded or stored.

Related tools