In short. Google determines page language from visible content and excludes HTML lang attributes and hreflang annotations from that detection.
Definition: No. As of 17 October 2026, Google's multilingual site documentation states that Google determines page language from visible content and excludes code-level language information, including HTML
langattributes, and URLs from that detection.
Key facts
- Google's multilingual site guidance recommends one language for a page's content and navigation and advises against side-by-side translations.
- Google's localized page documentation says
hreflang, an annotation connecting language or regional versions of content, also plays no part in language detection. - The W3C's HTML language guidance recommends declaring the default text language with
langon thehtmlelement.
What should a website make clear in its visible content?
Google's multilingual site documentation identifies visible page content as the basis for language detection. Its recommendation covers navigation as well as the main text. A review therefore examines the language of the actual page, including menus.
The same documentation warns about translating only recurring template text while leaving most content in another language. It names pages with user-generated content as a common example. Its stated concern is the experience of searchers seeing repeated content with differently translated surrounding text.
What does the HTML lang attribute do?
The HTML lang attribute declares the language of text in an element. The W3C's Declaring language in HTML recommends placing the default declaration on the root html element. Its English-language example is:
<html lang="en">
Other elements inherit this language setting. The root element also covers text inside the document's head, which a declaration on body would miss. For a passage in another language, the guidance recommends putting a language attribute on an element surrounding that passage.
Google's supported tags and attributes documentation separately states that Search identifies language through page text and disregards language annotations for that purpose. A valid language declaration remains part of the W3C's authoring guidance even with Google's independent detection approach.
How does hreflang fit into this?
Google's localized page documentation defines hreflang as a way to identify related versions of the same content for different languages or regions. Google uses algorithms to identify page language.
For an HTML implementation, the documentation places alternate-version links inside head. Each version lists itself and the other versions, and linked versions must point back to each other. Reviewing those relationships is a separate task from reviewing the language of the page text.
Related terms
FAQ
Should I remove lang because Google detects language independently?
Keep an accurate declaration: the W3C recommends lang on the html element to identify the default language of the document's text. Google's detection approach leaves that authoring recommendation relevant.
Can changing lang fix a page whose main text is in the wrong language?
Google's multilingual guidance bases detection on visible content. Review the actual text and navigation when checking a translation; changing the attribute alone leaves that content in its existing language.
Sources
- Google Search Central, "Managing multi-regional and multilingual sites", 10 December 2025
- Google Search Central, "Tell Google about localized versions of your page", 21 September 2026
- W3C, "Declaring language in HTML", 23 June 2021
- Google Search Central, "meta tags and attributes that Google supports", 10 December 2025
Check how a page reads to answer engines. Open the GEO score analyzer