How to Add the Lang Attribute to Your Shopify & WooCommerce Store
errorThe Problem
Your HTML document is missing the lang attribute on the <html> tag. This attribute tells browsers and search engines what language your content is written in (e.g., 'en' for English). Without it, assistive technologies may use the wrong pronunciation, and search engines may have difficulty determining your content's language.
trending_upWhy It Matters for SEO
The lang attribute is a basic accessibility requirement (WCAG 2.1 Level A) and helps search engines serve your pages to the right audience. It's especially important for international stores or stores that serve multilingual communities. Missing it can also slightly affect your Lighthouse accessibility score.
buildHow to Fix It
- 1
Go to Shopify Admin → Online Store → Themes → Edit Code.
- 2
Open layout/theme.liquid.
- 3
Find the <html> tag (should be near the top of the file).
- 4
Add the lang attribute with your primary language code.
- 5
Save the file.
<!-- Find your <html> tag and add the lang attribute -->
<html lang="{{ request.locale.iso_code | default: 'en' }}">
<!-- If your theme doesn't support request.locale, use a static value: -->
<html lang="en">Related Fix Guides
How to Fix a Missing Viewport Meta Tag on Shopify & WooCommerce
Fix the missing viewport meta tag on your store. Without it, your site looks broken on mobile devices. Copy-paste fix included.
How to Add a Skip-to-Content Link for Accessibility & SEO
Add a skip-to-content link to your Shopify or WooCommerce store for better accessibility and SEO. Copy-paste code included.
Want to check if YOUR store has this issue?
Scan your site for free — get copy-paste fixes in 60 seconds.
searchScan Now — It's Free