Why it matters
If you run a site in more than one language, or separate versions for the UK and the US, hreflang tells Google which one to show each searcher. Without it, the wrong version ranks, or the versions compete as duplicates.
Hreflang is also easy to get wrong: 'en-UK' is not a valid code (the UK is GB), every version must list all the others and itself, and mistakes are silently ignored. This generator writes the full set and checks the codes.
How it works
- InputThe URL of each language version
- In your browserCodes checked, return links completed
- OutputHead tags, sitemap entries and Link headers
Where it fits in a designer's workflow
- Plan
- Design
- Build
- Test
- Launch
By the numbers
Show the numbers as a table
| Languages | Tags in total |
|---|---|
| 2 | 6 |
| 3 | 12 |
| 4 | 20 |
| 6 | 42 |
| 8 | 72 |
| 10 | 110 |
How to use it
- List each language or region code and that version's address.
- Add an x-default line for visitors who match none of them.
- Read the checks and fix anything in red.
- Put the same set of tags on every version of the page, or use the sitemap output instead.
FAQ
Is it en-GB or en-UK?
en-GB. Region codes are ISO 3166, where the United Kingdom is GB. 'en-UK' is invalid and ignored.
Does every page need the tags?
Every version of a page must carry the same full set, including a link to itself. If page A links to B but B doesn't link back, both are ignored.
Tags, sitemap or headers?
They do the same job; use one. Tags are simplest for a few pages, sitemaps scale better, and headers are for files like PDFs.
Does Bing use hreflang?
Bing relies mostly on the content-language meta tag and html lang. It's worth setting both as well.