How to fix html lang on WooCommerce
Add a correct `lang` attribute to your site's `<html>` tag so browsers, search engines, and assistive technologies know what language your store is written in.
Steps for WooCommerce
- In your WordPress admin, go to Appearance › Theme File Editor (or use an FTP/file manager).
- Select your active theme in the top-right dropdown, then open header.php (or the equivalent root template — some block themes use html.php or parts/header.html).
- Locate the <html opening tag. WordPress typically outputs it via the language_attributes() template tag, which automatically inserts the correct lang attribute based on your site's configured language.
- If language_attributes() is already present (e.g., <html <?php language_attributes(); ?>>), the lang value is controlled by Settings › General › Site Language in the WordPress admin — set that to your correct language there.
- If the tag is hard-coded without language_attributes(), replace it with: <html <?php language_attributes(); ?>>
- Save, then check View Page Source on the frontend to confirm lang= appears in the <html> tag.
<html lang="en-US">What is html lang?
Every web page starts with an `<html>` tag. Adding a `lang` attribute to that tag — for example, `<html lang="en">` for English — tells browsers, screen readers, and search engines what human language the page is written in. It is a single line of code that lives at the very top of every page on your site. Without it, software has to guess your language, and it often guesses wrong.
Search engines like Google use the `lang` attribute to serve your pages to users searching in the right language and country, which directly affects how much relevant organic traffic you receive. Screen readers used by visually impaired shoppers rely on it to pronounce words correctly — missing or wrong language declarations are one of the most common WCAG accessibility failures, and in many jurisdictions selling online without meeting basic accessibility standards carries legal risk. Browser features like built-in translation also depend on this attribute, so without it, customers browsing in a different language may get broken or missing translation prompts, reducing conversions. It is one of the easiest fixes on your entire site and leaves no good reason to skip it.
See the complete Html lang guide for every platform and the full background.
Not sure if your WooCommerce store has this?
Run a free SEOLZ audit — we’ll find html lang and every other issue across your whole site.
Scan my site free