Language Attribute

No Comments
Language attribute

The language attribute is the HTML lang attribute on the opening html tag that declares the primary language of a page's content.

It takes a value from the BCP 47 standard, such as en for English, fr for French, or a region-specific form like en-GB or fr-CA. Browsers, screen readers, and translation tools read this attribute to handle the page correctly, choosing the right pronunciation, hyphenation, and font rendering. For accessibility it is important, since assistive technology depends on it to speak content in the correct voice.

<html lang="en">
<html lang="fr-CA">

In search, the lang attribute is a supporting signal rather than the main one. Google determines a page's language primarily from the visible content, not from the declared attribute, so a mismatch between the two sends a confusing message but the content usually wins. The lang attribute is not the same as hreflang. Hreflang annotations tell Google about alternate language and region versions of a page and live in link tags, HTTP headers, or the sitemap, while lang describes only the language of the current document.

On a multilingual site, set lang accurately on every page and keep it consistent with both the content and the hreflang setup. A page that serves French content should declare a French lang value and be referenced by matching hreflang annotations on its alternates.

Related: Hreflang guide, Where to declare hreflang

Claude Vincent is a technical SEO consultant focused on crawlability, rendering, and AI-search visibility. He writes the field guides and case studies at SEO ProCheck, with a bias toward the durable, unglamorous work that decides whether search engines and AI answer engines can actually read and cite a site.

About SEO ProCheck

Technical SEO consulting and GEO strategy with 20 years of enterprise experience. Case studies, resources, and tools for search and AI visibility.

Work With Me

Technical SEO audits, GEO strategy, site migrations, and international SEO. Hourly consulting for teams who need hands-on support, not just reports.

Subscribe to our newsletter!

More from our blog