What is Hreflang & what does it do? The hreflang tag, like the standard and pagination tags, is an HTML tag that represents the relationship between two pages. In the case of hreflang, it means that both URLs use different languages to hold the same content, or use the same language but target different geographic regions.
When done correctly, each hreflang tag tells bots to read the page in order to find the right content for users who don't speak the first page language. When someone performs a search, Google (Bing doesn't use hreflang tags) does the following:
- It decides to rank URLs according to the algorithm
- It checks the page's code, looking for hreflang tags
- It looks at the user's current location (based on IP address) and language settings
- It displays the most relevant URL in the SERPs and sends the user (if clicked) to that URL
The reason search engines check hreflang tags is that it can provide the correct version of the page based on the user's language settings. In short, this is how Google knows which URL to show for Spanish speakers, and which one for English speakers. It is also how to know which version is available in the United States and the United Kingdom.
How to add Hreflang to your page If you have an HTML page, the hreflang tag <head>looks like this:
For non-HTML pages (like PDFs), add hreflang comments in the HTTP header:
In the example above, the hreflang="en" part of these tags tells Google that the URL listed is the English version of the page, so it shows the URL to users who have set their English language in the browser to their language, English-speaking country. If they have hreflang="es", Google will show the URL for Spanish-speaking users.
When adding hreflang tags to your pages, you must include links to each version of the page, including self-references. So, if you have pages in English, Spanish, and French, each page has three tabs:
Geolocation can be added to the hreflang tag by adding the country code after the language code in the hreflang attribute. So, if the above website targets different countries and each language, they will look like this:
When Google sees these labels, it knows to show the English version to users in the United States, Mexico and France.
The hreflang value must always be written to the language country, and geotargeting is limited to the country. Google does not support cities, regions, or continents.
Language codecan be found here:
https://zh.wikipedia.org/wiki/IS ... 3%E7%A0%81%E8%A1%A8
Country codeOver here:
https://zh.wikipedia.org/wiki/%E ... 0%E4%BB%A3%E7%A2%BC
|