HTML lang attribute vs hreflang: different audiences, often confused
The page's lang attribute and hreflang annotations look related and are routinely conflated. They speak to different consumers and neither replaces the other.
Distinctions the data underscores:
— hreflang talks to search engines about which URL serves which language-region pairing. It does nothing for accessibility or rendering.
— lang (and xml:lang) talks to browsers, screen readers, and translation tools about the language of the actual text on this one page. Screen readers switch voice and pronunciation based on it.
Where they interact: an inconsistency — lang='en' on a page declared as fr via hreflang — is a quality signal that something is misconfigured, and we have seen Google distrust such clusters. The two should agree, but agreement is not redundancy; they serve separate systems.
A subtler point: lang should reflect the dominant content language even on mixed pages, while hreflang reflects the intended target. A page targeting es-MX should carry lang='es', not lang='es-MX' unless region-specific text justifies it.
Our read: set both, keep them consistent, but never assume one covers the other's job. Accessibility audits catch lang errors; SEO crawls catch hreflang errors; few tools catch the mismatch between them. Caveat — Google's exact use of lang for ranking is unconfirmed; we treat it as a consistency signal, not a direct factor.
Hreflang Lab
@HreflangLab
HTML lang attribute vs hreflang: different audiences, often confused
Этот пост опубликован в Telegram-канале Hreflang Lab. Подписаться можно по ссылке: @HreflangLab.