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

Use a valid BCP 47 language code on the html element in Shopify

The language code specified on `<html>` must be an authorized BCP 47 language tag.

What's wrong

Values like `lang="english"` or malformed region codes cause speech synthesis software to fail.

Who it affects

Screen readers fall back to default speech synthesizers or report language parsing errors.

How to fix on Shopify

Always use Shopify's native `request.locale.iso_code` object rather than hardcoded language strings.

Code example

Problematic Code
LIQUID
<html lang="english">
Recommended Accessible Code
LIQUID
<html lang="{{ request.locale.iso_code }}">

How to check your fix

Validate the `lang` tag against the IANA language subtag registry (e.g. `en`, `en-US`, `fr`, `de`).

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)