If the same site exists in Portuguese and English, or in different versions for different countries, Google needs to know which pages are the same, in another language or for another country. The hreflang tag tells it. Without it, it may show the wrong version to a searcher, or treat the versions as duplicates.
How it works
Each page lists, in the <head>, all of its versions, including itself:
<link rel="alternate" hreflang="pt-PT" href="https://asuaempresa.ao/pt/" />
<link rel="alternate" hreflang="en" href="https://asuaempresa.ao/en/" />
<link rel="alternate" hreflang="x-default" href="https://asuaempresa.ao/" />
| Part |
What it is |
| The language code |
Two letters, such as pt or en. The region is optional and goes after a hyphen: pt-PT, pt-BR. A region on its own is not accepted. |
x-default |
The page for those who fit none of the versions, such as a language chooser. |
| Reciprocity |
If page A lists B, B must list A. Without the return, Google ignores the pair. |
| Full addresses |
With https and the domain, and equal to each version’s canonical. |
Setting up a multilingual site
| 1 |
Give each language its own address: a folder (/pt/, /en/), a subdomain or a country domain. A folder is the simplest to maintain.
|
|
| 2 |
Translate the page, not just the menu. An English page with Portuguese text is a useless duplicate.
|
|
| 3 |
Put hreflang on all versions. On WordPress, a language plugin usually writes it for you; confirm in the page source (Ctrl+U) by searching for hreflang.
|
|
| 4 |
Each version points its canonical at itself, not at the main version. See the canonical tag.
|
|
| 5 |
Let the visitor choose. A visible language selector is better than sending people automatically by country: Google visits from various places and may never see the other version.
|
|
One language, several countries
If you have the same language for different countries (Portuguese for Portugal and Brazil, say), hreflang says which to show to whom. The text must really be adapted to the country: vocabulary, currency, contacts. Two pages almost identical in everything is the case where Google most often folds them into one. Choosing the domain by country is in how to choose the right domain.
The usual mistakes: a missing return (A lists B, B does not list A), a wrong code (pt_PT with an underscore instead of a hyphen, or the country name instead of the language code), an address that redirects, and versions that robots.txt blocks. hreflang helps Google choose, but does not force it.
|
|
Test with samples. Pick two pages, view each one’s source and confirm each lists the other. Then check in Search Console, in URL Inspection, that both are read.
|
|
Want to put your site in two languages and need to know how the server should be organised? Tell us the domain and what you have.
Open a support ticket
|
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from 5.940,00 Kz/mo (3-year plan, with coupon) See plans |