Hreflang is the annotation that tells search engines which language versions of a page exist on a multilingual site. A correct setup means every page lists itself and all its alternates, the annotations are reciprocal, an x-default is defined and every language version has a self-referencing canonical. One-way hreflang tags without a return link are ignored by Google.
What does the hreflang tag actually do?
The hreflang tag links the language or regional versions of the same content so Google can show each searcher the right one. Someone searching in Turkish gets the Turkish page; someone searching in English gets the English page. Hreflang is not a ranking factor; it prevents the wrong language version from appearing and stops versions being treated as duplicates.
Hreflang values start with an ISO 639-1 language code (tr, en, de) and can add an optional ISO 3166-1 Alpha-2 region code (en-GB, de-AT). A region code on its own is invalid, and the common 'en-UK' is wrong too; the correct value is 'en-GB'. Bing relies more on the html lang attribute and content-language signals than on hreflang, so set html lang correctly on every version as well.
Related services
What URL structure should a multilingual site use?
The most reliable URL structure for a multilingual site carries the language in the address itself: a subfolder (/en/), a subdomain (en.site.com) or a separate country-code domain. Sites that switch language through cookies, browser settings or JavaScript state serve several versions from one URL, and Googlebot usually sees only the default language version.
- —Subfolder (/en/): one domain, one pool of authority, simplest setup. The recommended structure for most SMEs and corporate sites.
- —Subdomain (en.site.com): sensible when a separate server or team is involved; authority may be split somewhat.
- —Country-code domain (site.de): a strong local signal, but each domain needs its own management and link building.
- —URL parameter (?lang=en): technically works but is not recommended; it causes confusion in sharing and reporting.
On the 404 Ajans site, Turkish content lives at the root (/) and English content under /en. Language is read directly from the URL path, not from application state, so /kocaeli-web-tasarim and /en/kocaeli-web-tasarim are two separate, crawlable, prerendered pages. The language switcher is simply a normal link to the matching URL. We do not auto-redirect visitors by browser language, because that can lock both users and bots out of the version they actually want.
What are self-referencing and reciprocal hreflang tags?
A self-referencing hreflang tag means a page includes itself in its own list of alternates; reciprocal hreflang means that if page A points to page B, page B must point back to page A. Google treats hreflang pairs without a return link as unreliable and ignores them. Every language version must therefore carry the same complete set of alternates.
A concrete example: the head of the Turkish /kocaeli-web-tasarim page contains three link elements. The first uses rel alternate with hreflang tr and points to the page itself, the second uses hreflang en and points to /en/kocaeli-web-tasarim, and the third uses hreflang x-default and points to the default URL. The English page carries exactly the same three tags. All addresses must be absolute URLs including https and the domain.
When should you use x-default?
The x-default value names the fallback page to show when no version matches the user's language or region. For example, when a German-speaking visitor reaches a site that only has Turkish and English versions, the URL marked x-default is the one suggested. x-default usually points to the main language version or to a language selector page.
Which version becomes x-default depends on business goals. An exporter chasing foreign demand may choose English; a business focused on the local market may choose Turkish. What matters is that the decision is consistent and that every language version declares the same x-default URL.
How do canonical and hreflang work together?
When canonical and hreflang are used together, each language version's canonical tag must point to its own URL. Pointing the English page's canonical at the Turkish page tells Google the English version is a duplicate that should not be indexed, and the hreflang signal is then discarded. Canonical resolves duplicates within a language; hreflang connects versions across languages.
Every URL in a hreflang set must be canonical, return a 200 status code and be indexable. Listing addresses that are noindexed, redirected or canonicalised elsewhere makes the signal fail silently. URLs that differ only by parameters or a trailing slash also count as different addresses, so keep the format consistent everywhere.
For your project
What are the five most common hreflang mistakes?
The five most common hreflang mistakes are missing return links, wrong language or region codes, relative URLs, canonical conflicts and switching language only with JavaScript. Each looks minor on its own, but the result is always the same: Google ignores the hreflang set and may show visitors the wrong language version.
- —Missing return links: the Turkish page points to the English one, but the English page has no tag pointing back.
- —Wrong codes: using 'en-UK', 'tr-TUR' or a region code alone. Correct forms are 'en-GB', 'tr' or 'tr-TR'.
- —Relative URLs: writing /en/page without the domain. Hreflang URLs must be absolute.
- —Canonical conflicts: canonicalising every language version to a single language.
- —JavaScript-only language switching: showing different languages on the same URL, so bots only see one.
Should hreflang go in the HTML or in the sitemap?
Hreflang can be declared in three places: link elements in the HTML head, xhtml:link entries in the XML sitemap, or HTTP headers for non-HTML files such as PDFs. Google treats all three equally. For small and mid-sized sites the HTML method is enough; for sites with thousands of URLs and many languages, the sitemap method keeps page weight down.
- —HTML head: anyone inspecting the page sees the tags, so debugging is easy. The head grows with every added language.
- —XML sitemap: no extra page weight and central management, but you have to inspect the sitemap separately to spot errors.
- —HTTP header: only meaningful for PDFs and other non-HTML files.
Using both HTML and sitemap is allowed, as long as the two sources never contradict each other. On the 404 Ajans site, hreflang tags are written into each page's prerendered HTML, and the sitemap is generated from the same content array, so adding a page never requires a manual update. After setup, check Search Console's indexing reports and a third-party hreflang checker regularly.
