What is hreflang attribute used for?

hreflang attribute country cheat sheet

CountryHreflang Code
AfghanistanAF
Aland IslandsAX
AlbaniaAL
AlgeriaDZ
American SamoaAS
AndorraAD
AngolaAO
AnguillaAI
AntarcticaAQ
Antigua and BarbudaAG
ArgentinaAR
ArmeniaAM
ArubaAW
AustraliaAU
AustriaAT
AzerbaijanAZ
BahamasBS
BahrainBH
BangladeshBD
BarbadosBB
BelarusBY
BelgiumBE
BelizeBZ
BeninBJ
BermudaBM
BhutanBT
Bolivia, Plurinational State ofBO
Bonaire, Sint Eustatius and SabaBQ
Bosnia and HerzegovinaBA
BotswanaBW
Bouvet IslandBV
BrazilBR
British Indian Ocean TerritoryIO
Brunei DarussalamBN
BulgariaBG
Burkina FasoBF
BurundiBI
CambodiaKH
CameroonCM
CanadaCA
Cape VerdeCV
Cayman IslandsKY
Central African RepublicCF
ChadTD
ChileCL
ChinaCN
Christmas IslandCX
Cocos (Keeling) IslandsCC
ColombiaCO
ComorosKM
CongoCG
Congo, the Democratic Republic of theCD
Cook IslandsCK
Costa RicaCR
Côte d’IvoireCI
CroatiaHR
CubaCU
CuraçaoCW
CyprusCY
Czech RepublicCZ
DenmarkDK
DjiboutiDJ
DominicaDM
Dominican RepublicDO
EcuadorEC
EgyptEG
El SalvadorSV
Equatorial GuineaGQ
EritreaER
EstoniaEE
EthiopiaET
Falkland Islands (Malvinas)FK
Faroe IslandsFO
FijiFJ
FinlandFI
FranceFR
French GuianaGF
French PolynesiaPF
French Southern TerritoriesTF
GabonGA
GambiaGM
GeorgiaGE
GermanyDE
GhanaGH
GibraltarGI
GreeceGR
GreenlandGL
GrenadaGD
GuadeloupeGP
GuamGU
GuatemalaGT
GuernseyGG
GuineaGN
Guinea-BissauGW
GuyanaGY
HaitiHT
Heard Island and McDonald IslandsHM
Holy See (Vatican City State)VA
HondurasHN
Hong KongHK
HungaryHU
IcelandIS
IndiaIN
IndonesiaID
Iran, Islamic Republic ofIR
IraqIQ
IrelandIE
Isle of ManIM
IsraelIL
ItalyIT
JamaicaJM
JapanJP
JerseyJE
JordanJO
KazakhstanKZ
KenyaKE
KiribatiKI
Korea, Democratic People’s Republic ofKP
Korea, Republic ofKR
KuwaitKW
KyrgyzstanKG
Lao People’s Democratic RepublicLA
LatviaLV
LebanonLB
LesothoLS
LiberiaLR
LibyaLY
LiechtensteinLI
LithuaniaLT
LuxembourgLU
MacaoMO
Macedonia, the Former Yugoslav Republic ofMK
MadagascarMG
MalawiMW
MalaysiaMY
MaldivesMV
MaliML
MaltaMT
Marshall IslandsMH
MartiniqueMQ
MauritaniaMR
MauritiusMU
MayotteYT
MexicoMX
Micronesia, Federated States ofFM
Moldova, Republic ofMD
MonacoMC
MongoliaMN
MontenegroME
MontserratMS
MoroccoMA
MozambiqueMZ
MyanmarMM
NamibiaNA
NauruNR
NepalNP
NetherlandsNL
New CaledoniaNC
New ZealandNZ
NicaraguaNI
NigerNE
NigeriaNG
NiueNU
Norfolk IslandNF
Northern Mariana IslandsMP
NorwayNO
OmanOM
PakistanPK
PalauPW
Palestine, State ofPS
PanamaPA
Papua New GuineaPG
ParaguayPY
PeruPE
PhilippinesPH
PitcairnPN
PolandPL
PortugalPT
Puerto RicoPR
QatarQA
RéunionRE
RomaniaRO
Russian FederationRU
RwandaRW
Saint BarthélemyBL
Saint Helena, Ascension and Tristan da CunhaSH
Saint Kitts and NevisKN
Saint LuciaLC
Saint Martin (French part)MF
Saint Pierre and MiquelonPM
Saint Vincent and the GrenadinesVC
SamoaWS
San MarinoSM
Sao Tome and PrincipeST
Saudi ArabiaSA
SenegalSN
SerbiaRS
SeychellesSC
Sierra LeoneSL
SingaporeSG
Sint Maarten (Dutch part)SX
SlovakiaSK
SloveniaSI
Solomon IslandsSB
SomaliaSO
South AfricaZA
South Georgia and the South Sandwich IslandsGS
South SudanSS
SpainES
Sri LankaLK
SudanSD
SurinameSR
Svalbard and Jan MayenSJ
SwazilandSZ
SwedenSE
SwitzerlandCH
Syrian Arab RepublicSY
Taiwan, Province of ChinaTW
TajikistanTJ
Tanzania, United Republic ofTZ
ThailandTH
Timor-LesteTL
TogoTG
TokelauTK
TongaTO
Trinidad and TobagoTT
TunisiaTN
TurkeyTR
TurkmenistanTM
Turks and Caicos IslandsTC
TuvaluTV
UgandaUG
UkraineUA
United Arab EmiratesAE
United KingdomGB
United StatesUS
United States Minor Outlying IslandsUM
UruguayUY
UzbekistanUZ
VanuatuVU
Venezuela, Bolivarian Republic ofVE
Viet NamVN
Virgin Islands, BritishVG
Virgin Islands, U.S.VI
Wallis and FutunaWF
Western SaharaEH
YemenYE
ZambiaZM
ZimbabweZW

7 basic questions you’ve always wanted to ask? what is hreflang attribute used for?

The hreflang attribute is very often misinterpreted and misunderstood. Today we will go through the facts exclusively, answering the most frequently asked questions.

Hreflang is a fairly simple SEO tool that allows you to get rid of the ambiguity on a multilingual site and assign a specific region to each set of pages.

For example, you have a web page for Russian-speaking users and exactly the same pages in English, German, French. Hreflang allows you to specify which specific region each of them is for.

Problems only arise when experts misinterpret the specification, or when your web infrastructure is not unified in a way that makes matching easier.

hreflang attribute Language Cheat Sheet

LanguageHreflang Code
Abkhazianab
Afrikaansaf
Aragonesean
Arabicar
Assameseas
Azerbaijaniaz
Belarusianbe
Bulgarianbg
Bengalibn
Tibetanbo
Bretonbr
Bosnianbs
Catalan / Valencianca
Chechence
Corsicanco
Czechcs
Church Slaviccu
Welshcy
Danishda
Germande
Greekel
Englishen
Esperantoeo
Spanish / Castilianes
Estonianet
Basqueeu
Persianfa
Finnishfi
Fijianfj
Faroesefo
Frenchfr
Western Frisianfy
Irishga
Gaelic / Scottish Gaelicgd
Galiciangl
Manxgv
Hebrewhe
Hindihi
Croatianhr
Haitian; Haitian Creoleht
Hungarianhu
Armenianhy
Indonesianid
Icelandicis
Italianit
Japaneseja
Javanesejv
Georgianka
Kongokg
Koreanko
Kurdishku
Cornishkw
Kirghizky
Latinla
Luxembourgish; Letzeburgeschlb
Limburgan; Limburger; Limburgishli
Lingalaln
Lithuanianlt
Latvianlv
Malagasymg
Macedonianmk
Mongolianmn
Moldavianmo
Malayms
Maltesemt
Burmesemy
Norwegian (Bokmål)nb
Nepaline
Dutchnl
Norwegian (Nynorsk)nn
Norwegianno
Occitan (post 1500); Provençaloc
Polishpl
Portuguesept
Raeto-Romancerm
Romanianro
Russianru
Sardiniansc
Northern Samise
Slovaksk
Sloveniansl
Somaliso
Albaniansq
Serbiansr
Swedishsv
Swahilisw
Turkmentk
Turkishtr
Tahitianty
Ukrainianuk
Urduur
Uzbekuz
Vietnamesevi
Volapükvo
Yiddishyi
Chinese (simplified)zh-hans
Thaith

In this article, we’ll tackle some of these common problems and misinterpretation of the spec by finding answers to 7 simple about hreflang attribute but frequently asked questions.

1. I have a website in English that is for the US, UK, and Ireland. Can I use “Hreflang = en-us-gb-ie”?

Answer: No, you cannot. I understand that you are creative and want to get better.

If you have the same set of pages for several English-speaking countries, you can use a simple design without
specifying regions.

<link rel = ”alternate” hreflang = ”en” href = ”https://www.moomez.com/en/page.html” />

In the case of different sets of pages for different English-speaking regions (eg Australia and Singapore), you need to set specific target countries. To do this, create a separate line for each country, even if the URL is the same for everyone.

<link rel = ”alternate” hreflang = ”en-ie” href = ”https://www.moomez.com/en/page.html” />

<link rel = ”alternate” hreflang = ”en-gb” href = ”https://www.moomez.com/en/page.html” />

<link rel = ”alternate” hreflang = ”en-us” href = ”https://www.moomez.com/en/page.html” />

2. I have one site for all European countries and another for the entire Middle East. Can I use “EU” and “ME” as a country setting in hreflang?

For Example:

<link rel = ”alternate” hreflang = ”en-EU” href = ”https://www.moomez.com/en/page.html” /><link rel = ”alternate” hreflang = ”en-ME” href = ”https://www.moomez.com/en/page.html” />

Answer : Only valid International Organization for Standardization (ISO) country codes and languages ​​can be used in the hreflang tag. There are no EU, EMEA, APAC, or ME area codes.

Many companies have regional sites targeting Latin America (LatAm), the European Union (EU), or the Middle East (ME), which represent several countries with different languages ​​in the region but try to use the same “common” code for the entire region …

The most common mistake here is trying to use es-LA to represent the Spanish language site in Latin America. Unfortunately, such a “trick” will not work, since you tell the search engine that it is Spanish, targeting the country of Laos.

3. Can I combine canonical and hreflang tags on one line?

For Example:

<link rel = ”canonical, alternate” hreflang = ”en-gb” href = ”https://moomez.com/en-uk/page.html” />

Answer: No, you need to separate the canonical tag from the hreflang tags.

<link rel = ”canonical” href = ”https://moomez.com/en-uk/page.html” />

<link rel = ”alternate” hreflang = ”en-gb” href = ”https://www.moomez.com/en-uk/page.html” />

<link rel = ”alternate” hreflang = ”en-us” href = ”https://www.moomez.com/en-us/page.html” />

If your technical SEO or a developer wants to get creative, recommend that they study the hreflang spec (Yandex , Google ) and not deviate from the standard syntax, as this tag is quite complex.

4. We use CMS to automatically generate XML sitemap files. It includes non-existent URLs. Can this be allowed? I see them in GSC bug reports. This is bad?

Answer : Yes, this is bad. This is a serious problem for many companies.

The problem is caused by the CMS set to automatically generate URLs for each language or country when a new page appears on the site. Sometimes these URLs are generated according to general navigation rules, even if the page itself is not there.

Unfortunately, there is no easy way to deal with this problem. Non-existent URLs should not be included in the XML sitemap.

The actual solution depends on your CMS. Start by looking at the rules for creating URLs (parent and child). Or from the rules for generating pages for regions. In most cases, they are not properly tuned.

It is possible that these rules are being overridden by JavaScript navigation rules or IP discovery and redirection protocols. Most systems provide a “fallback” page in the absence of localization or accurate mapping to the region.

5. Do I need to use hreflang to manage content hosted on different domains, each targeting a different country?

Answer : Many companies have separate websites for different countries or languages. In this case, using hreflang for multiple domains (and subdomains) is not an easy task.

You need to use hreflang XML sitemaps that list all the URLs for each of the unique domains. And it would be better if the URL paths are the same. Or at least not very different. Otherwise, comparing them will turn into a difficult task.

For simplicity, it is usually recommended to use splitting of large sitemaps, and also to concentrate all XML map files on one site, in the root directory, instead of having to struggle with dozens or hundreds of domains.

6. Should I use a specific URL or home page as the x-default?

Answer : There is always a lot of confusion about x-default.

X-default is a directive to use a specific page for any language or region that does not have a separate hreflang rule.

What to show to users who don’t have a local version? In this case, many companies display a global version of the site or a version in English. Note that only one of these can be defined for x-default.

If you set the home page as x-default for pages other than the home page, search engines will think that it should be shown instead of any other pages in regions that are not listed in the hreflang tags. And you won’t be able to dynamically switch this rule based on the visitor’s IP.

Yes, it has been tested in practice. No, it doesn’t work, not at all.

7. I have content in two different languages ​​within one page of the site. Can I write both for it in the hreflang tag?

Answer: Each page should only contain content in one language. However, different languages ​​are common on UGC sites. As a general rule, you should set the primary language region or the default region.

For example, if your site is initially aimed at a Russian-speaking audience, but on some page, there is a lot of content generated by users in Ukrainian, the region should be “UA”.

Let’s sum up of What is hreflang attribute used for

Hopefully, this article has shown you that the hreflang tag is not overly complicated. As a rule, difficulties arise with it due to the confusing architecture of the website.

Start with a couple of languages ​​or two groups of pages, and test everything properly. After you see the return, you can clearly demonstrate to the management (or yourself) the importance of allocating resources for a larger implementation of multilingualism.

Leave a Comment