Skip to content
ShopifyRule: html-has-lang•Reviewed Oct 2026

Add the lang attribute to the html element in Shopify

The root `<html>` element must declare the document's primary language using a valid `lang` attribute.

What's wrong

Omitting the `lang` attribute causes assistive technology to default to the user's system language, mispronouncing words.

Who it affects

Screen reader users hear English text spoken using French or German phonetic engines, making text unintelligible.

How to fix on Shopify

In `layout/theme.liquid`, set `<html lang="{{ request.locale.iso_code }}">`.

Code example

Problematic Code
LIQUID
<!doctype html>
<html>
Recommended Accessible Code
LIQUID
<!doctype html>
<html class="no-js" lang="{{ request.locale.iso_code }}">

How to check your fix

Inspect the root element in DevTools Elements panel. Verify `<html lang="en">` (or matching store locale) is present.

Check if your site has this issue

Scan any public store page free against WCAG 2.2 AA in 30 seconds.

Your session has ended

Sign in again to carry on. Anything you typed on this page is kept.

Signed in another way? Use another method (opens a new tab)