When a site serves several languages or country versions of the same page, search engines need a map that says which URL belongs to which audience. Hreflang tags are that map, and they are notoriously easy to get subtly wrong: a missing return tag, a country code where a language code belongs, or one page that forgets to list itself, and the whole cluster is ignored. This generator removes the hand-typing from the process. You list each version of the page once, and it produces the complete, self-referencing tag set every page in the cluster must carry.
Quick Answer: Add one row per language version with its full URL, language and optional region code, tick x-default if you use one, and click Generate. Copy the full block of link tags into the head of every version of the page.
How to Use the Hreflang Tag Generator
- Enter the URL of the first language version and choose its language code, plus a region code if the version targets one country.
- Click Add Row for every other version of the same page, filling in its own URL and codes.
- Tick the x-default option and choose which URL should act as the fallback for unmatched visitors, if you use one.
- Click Generate Hreflang Tags and check the preview: every row should appear as its own link tag.
- Copy the complete block and paste it into the head section of every version of the page, unchanged on each one.
Key Features
- Builds the full self-referencing set automatically: each URL gets a tag, which is the rule most hand-written sets break.
- Language and region pickers based on the standard codes, so you pick en-GB from a list instead of guessing the format.
- Optional x-default tag for the fallback page shown to visitors who match no language or region.
- Unlimited rows for large international clusters, with row removal for corrections.
- Clean output with one tag per line, ready to paste into a CMS template, a tag manager or raw HTML.
Best Practices and Tips
- Every page in a cluster must carry the identical tag set, including a tag pointing at itself; partial sets are ignored by search engines.
- Use the language code first and the region second (en-GB, not GB-en), and never use a region code on its own.
- Point every tag at the canonical, indexable version of the URL: no redirects, no parameters, no http copies of an https page.
- If one version of a page is removed, regenerate the set for the whole cluster so no tag points at a dead URL.
Common Mistakes to Avoid
- Listing only the other versions and forgetting the page’s own URL, which breaks the self-referencing rule.
- Using country codes that are not valid for the language, such as en-UK instead of en-GB.
- Putting different tag sets on different versions of the same page after editing only one template.
- Adding hreflang to pages that are noindexed or blocked, which wastes the signal and can cause the cluster to be dropped.
Frequently Asked Questions
What does hreflang actually do?
It tells search engines which language and region each URL is for, so a searcher in France is shown the French version rather than the German one. It is a hint about which page to display, not a ranking boost by itself, and it does not translate anything.
Do I need hreflang if my site only targets one country?
If the site has a single language version for a single country, hreflang adds nothing and you can skip it. It becomes valuable the moment a second language or a second country version of similar content exists.
What is x-default and should I use it?
The x-default tag names the fallback URL for visitors whose language and region match nothing else, often a language selector page or the main global version. It is optional, but large international sites benefit because no visitor falls through the cracks.
Can I put hreflang tags in an XML sitemap instead?
Yes, the same relationships can be declared in a sitemap with xhtml:link entries, which suits very large sites. The tags this tool generates are the HTML equivalent and are simpler to manage for page clusters of a few dozen versions.
Why are my hreflang tags being ignored?
The usual causes are missing return tags, one page in the cluster carrying a different set, URLs that redirect, or codes written in the wrong order. Regenerating the complete set with this tool and pasting it identically onto every version fixes most cases.
Related Tools