1001Ferramentas
🌎SEO

Link Alternate Builder

Build the <link rel="alternate" hreflang> tag for language variants.



  

Build hreflang tags without syntax slips

Your site has a Portuguese version and an English one, and Google keeps serving the wrong one to visitors from abroad. The rel=alternate plus hreflang pair exists precisely to say which version suits which audience, and the syntax is short enough to look foolproof, which it very much is not in practice.

Two fields, the language code and the URL, produce one line ready for the head. The tool builds a single tag at a time, so three languages means running it three times and pasting all three. The code follows ISO 639-1, optionally with a region, as in pt, pt-BR, or en-GB. A region on its own is invalid since the language is mandatory, and the x-default value marks the fallback version for visitors who match nothing else.

The set has to be reciprocal: if the Portuguese page points at the English one, the English page must point back, or Google discards the whole cluster. Include a tag pointing at the page itself too. And always use the same URL that sits in rel=canonical, because pointing hreflang at an address that canonicalizes elsewhere is the single most common mistake in this area. The tool validates neither the code nor the URL, it only assembles the line, so check it before shipping.

Frequently asked questions

Should I use pt or pt-BR?
Use the bare language when the content serves every country speaking it. Add the region when you genuinely have country-specific versions differing in price, shipping, or legal terms.
Do I need a tag pointing at the page itself?
Yes. The self-referencing tag is part of the cluster, and without it Google tends to ignore the annotations entirely.
Can hreflang live outside the head?
It can. The XML sitemap and the HTTP Link header are both valid, and useful for PDFs and other files with no head. Pick one method and stick to it.

Related Tools