What hreflang is for
If your website is in Slovak, Czech and English, those are three versions of the same page. Hreflang tells Google that they belong together and which one is for whom. A Slovak user then sees the Slovak version in the results and a Czech user the Czech one. Without hreflang, Google may show a Slovak user the Czech page with prices in koruna, or treat similar versions as duplicate content.
How it is written
The head of each language version contains a list of all versions with a language code and, where needed, a country code. For example, sk for Slovak, cs for Czech, en for English. If you have different versions for countries that share a language, you also use the country code, for example de-DE and de-AT. You can also add x-default for visitors whose language you do not have a version for.
Rules that are often broken
- Links must go both ways. If the Slovak page points to the Czech one, the Czech page must point back to the Slovak one. Otherwise Google ignores the tag.
- Each version also lists itself.
- Correct codes: Czech is cs. The code cz refers to the country, not the language.
- The URLs must work, with no redirects and no 404 errors.
- Consistency with the canonical URL: the canonical tag of each version should point to itself, not to another language version.
A real-world example
An outdoor equipment shop from Bratislava expanded its sales to the Czech Republic. The Czech version had its own translations and prices in CZK, but Google.cz kept showing the Slovak pages. The translation plugin did add hreflang, but it was missing on products translated later, and the codes were set to “cz”. Once this was fixed, Czech customers started seeing the right version.
A practical tip
On WordPress with Polylang or WPML, hreflang is set automatically as long as the pages are correctly linked to each other as translations. Untranslated pages stay unlinked and get no hreflang. Check it especially after a product import and when adding new languages. This is part of technical SEO. I build multilingual websites with correctly set up hreflang as part of website development.