Hreflang and AI search: the right language
WebAISEO: free AI-search checkAll guidesWebAISEO TermsFor AI agents
Our check cannot see which language version an AI assistant quotes: that is decided inside each assistant, question by question, and none of them documents the choice. What a site controls is whether every language version can be found, says which language it is in, and points to the others. Here is how our own site does it, and how our scans count language copies.
What tells a crawler which language a page is in?
Three labels in the page do the work. The lang attribute on the <html> element names the language of
the text. Each version's own canonical address says that this copy is a page of its own, not a duplicate of the English one. And
hreflang alternates list every version of the page with its language code, so a crawler that lands on one copy finds the
others. Google says it does not use hreflang or the lang attribute to detect a page's language (its own systems read the text), and it
uses hreflang to tell which pages are versions of each other.
How does our own site do it?
TrueTest is published in 26 languages: English and 25 translations (as of 17 November 2026). Each of our 10 translated pages (the home page, How we test, Security and the other main pages) carries 27 hreflang values: one per language, plus x-default pointing at the English page for readers whose language is not on the list. Each copy has its own address, such as /es/methods, a canonical address pointing at itself, and lang="es" on its html element. The English guides, this one included, are not translated and carry no alternates.
How do our scans count language copies?
When the full audit reads several pages of a site, a page and its language copies count as one page: addresses linked as hreflang alternates, or the same path under a language code such as /es/ when that path also exists without the code or under another one. The copies are read only when the site has fewer different pages than the audit reads. The free check reads the one page you type in, so it sees one language copy at a time.
What should I check on my own site?
- Every language version has its own address; none is shown only by a cookie or a browser setting.
- Each version's canonical points at itself, not at the English page.
- The alternates go both ways: Google says that if page A lists page B but B does not list A, it may ignore the pair.
- Codes are a language (ISO 639-1, such as es) with an optional region (ISO 3166-1, such as pt-BR); a region on its own is not valid.
- The main text is really translated: Google treats copies whose main content is still in the original language as duplicates.
Hreflang can sit in the HTML head, in HTTP headers or in the sitemap; Google treats the three ways the same, so one is enough. The canonical side of this is on canonical URLs and AI citations.
Sources (read 17 November 2026)
Related pages
- Canonical URLs and AI citations
- Sitemaps, HTTPS and speed for AI crawlers
- llms.txt checker and validator
- Is my website visible in ChatGPT?
- All AI-search guides
- WebAISEO home: the free AI-search check
Questions people ask
Do I need hreflang if my site is only in English?
No. Hreflang links the language or region versions of one page; a page with one version needs none.
Can hreflang go in the sitemap instead of each page?
Yes. Google lists HTML link elements, HTTP headers and the sitemap as equivalent ways; one of them is enough.
What is x-default for?
It names the page for readers whose language or region matches none of your versions, often a language picker or the main version.
Is the one-page check free?
Yes, for one public page, with no sign-up.