Hreflang Generator
Workspace
What is the Hreflang Generator?
The Hreflang Generator builds <link rel="alternate" hreflang="..."> tags that tell search engines which language or regional version of a page to show for a given audience. You paste the tags into the <head> of your page. Hreflang is a hint, not a redirect: it does not send visitors to another version by itself.
The workspace has two inputs: a Default URL and a Language Versions list. The tool outputs one hreflang line per language code plus an x-default line that points to the Default URL.
How to Use the Hreflang Generator
- Enter the Default URL, for example
https://example.com/page. This is also used for thex-defaultline. - In Language Versions, enter one entry per line in the form
lang_code URL, for exampleen https://example.com/en/page. - Click Process.
- Copy the Generated Code from the result panel.
- Paste the tags into the
<head>of the corresponding page, and check every href before publishing (see Limitations). - Click Clear to start over.
Worked Example
Input tested on this page: Default URL https://example.com/page; Language Versions en https://example.com/en/page, fr https://example.com/fr/page, es https://example.com/es/page.
Observed output:
<link rel="alternate" hreflang="en" href="https://example.com/page"> <link rel="alternate" hreflang="es" href="https://example.com/page/es"> <link rel="alternate" hreflang="fr" href="https://example.com/page/fr"> <link rel="alternate" hreflang="x-default" href="https://example.com/page">
Note that the output is sorted by language code (en, es, fr), not in the order typed.
Limitations
- Bug observed: the tool ignores the URLs typed after each language code. It derives each href from the Default URL instead:
enuses the Default URL itself, and other codes append/codeto it (for examplehttps://example.com/page/es). Do not assume your typed per-language URLs were used. Verify and correct every href before publishing. - It does not check that the language pages exist, return a successful response, or link back to each other. Hreflang works best when each version links to all other versions, including itself.
- It does not validate language or region codes, canonical tags, or trailing-slash consistency.
- It does not fetch pages, detect the page language, or confirm that the translated content matches.
Frequently Asked Questions
Does hreflang redirect visitors to their language?
No. Hreflang only signals to search engines which version to show in results. Redirects, language switchers, and server logic are separate.
What is x-default for?
The x-default line points to the fallback page shown when no language version matches the searcher. Here it points to the Default URL.
Do I need hreflang on every language version?
Yes, in practice. Each language version should carry the full set of hreflang tags for all versions, including itself, so search engines see a consistent cluster.
Will hreflang improve my ranking?
Not directly. It helps search engines show the right language version, which can reduce bounces from visitors landing on the wrong language, but ranking still depends on content, links, and other factors.
Related Tools
From the Blog
How to Merge PDF Files Into One Document (Without Losing Pages)
You have five PDFs. Your bank wants one file. Your university wants one file. Your client wants one file. Merging them is…
Read article →How to Recover a Hacked Account and Lock It Down Again
Losing an account feels personal. Your email holds your photos, your receipts, and the password-reset links for almost everything else you own…
Read article →What Are Passkeys and How to Set One Up on Your Google and Apple Accounts
A password is a secret you have to remember, type, and keep out of other people’s hands — and it fails at…
Read article →