The hreflang generator creates the link tags that tell Google which version of a page to show to speakers of each language or people in each country. Add one row per version, choose its language code, paste the URL, and copy the complete set, including x-default for everyone else.
Key takeaways
- Every version must list all versions, including itself. Missing return links are the top hreflang error.
- Use ISO codes: language (en) or language-country (en-GB). Country alone, such as “uk”, is invalid.
- Hreflang prevents translated pages from being treated as competing duplicates.
How to generate the tags
- Start with the default rows: x-default, Arabic and English. Change or remove them as needed.
- For each version, choose the language code and paste its full URL.
- Add more languages with the button; the tool warns you if a code is repeated.
- Copy the same block into the head of every version.
Language vs language-country
Use a plain language code when one version serves all speakers, such as fr for all French readers. Add a country only when content really differs by market, such as prices or legal terms: en-US and en-GB, or pt-BR and pt-PT. A page can have both a general and a regional version. The x-default tag names the page for users whose language you do not cover, often a language selector or your main version.
Why multilingual sites need hreflang
Without hreflang, an English page and its French translation look like two pages about the same entities. Google may show the wrong one, or rank neither well. Hreflang tells search engines they are alternatives, not duplicates, so each one ranks in its own market and the signals of the cluster support each other. It does not merge rankings or pass link equity on its own, so each version still needs its own internal links and, ideally, links from sites in that language.
Translation is not localization
Machine-translated copies with the same examples, currency and intent rarely win in a new market. Search intent changes between countries: people in Germany may search with different terms and expect different proof than people in Saudi Arabia. Research keywords in each language, adapt examples and calls to action, and have a native speaker review. This is also an E-E-A-T issue: local contact details, local reviews and native writing show real experience in that market. We run SEO and content in ten languages for exactly this reason.
Common hreflang errors
- No return tag: page A lists B, but B does not list A. Google may ignore both.
- Wrong codes: en-UK instead of en-GB, or jp instead of ja.
- Hreflang to redirected or noindex URLs. Every URL in the set must return 200 and be indexable; check them with the redirect checker.
- Canonical to another language. Each version should be canonical to itself.
Head tags, sitemap or headers?
You can add hreflang in three places: link tags in the page head, entries in the XML sitemap, or HTTP headers for PDFs. Pick one method and use it consistently. Head tags are easiest to check and suit most WordPress sites. For sites with thousands of pages in many languages, the sitemap method keeps the HTML lighter. After launch, watch the international targeting and indexing reports in Search Console for a few weeks, and test random pages with the on-page SEO checker to confirm the lang attribute matches the hreflang code.
Keep the language cluster connected
Hreflang works best when the rest of the site agrees with it. Add a visible language switcher that links each page to its translations, keep URLs predictable, such as /en/, /fr/ and /ja/, and translate titles, descriptions and alt text, not only the body. Internal links should stay inside the same language, so each version builds its own silo of related pages.
Need more than a free tool?
Our team runs full audits, fixes and growth plans for sites in 10 languages.Frequently asked questions
Do I need hreflang if I only have one language?
What is x-default?
Does Bing use hreflang?
Can hreflang point to another domain?
How long until Google uses my hreflang?
How we built this tool: the checks and thresholds follow Google Search Central documentation, Schema.org and the IETF/W3C standards, and we tune them against what we see on client sites every month. The tool runs in your browser and does not store the text or URLs you enter. Questions or a bug? Tell us.