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. 1

    Go to Shopify Admin → Online Store → Themes → Edit Code.

  2. 2

    Open layout/theme.liquid.

  3. 3

    Find the <html> tag (should be near the top of the file).

  4. 4

    Add the lang attribute with your primary language code.

  5. 5

    Save the file.

folderlayout/theme.liquid
<!-- 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">
menu_bookRead Google's official documentationopen_in_new

Related Fix Guides

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