How to fix html lang on Adobe Commerce (Magento)
Add a lang attribute to your site's <html> tag that matches the primary language of your store's content.
Steps for Adobe Commerce (Magento)
- In Magento admin, go to Content → Design → Configuration.
- Select your store view and look for HTML Head settings — Magento does not set lang via this UI, so you must edit the root template.
- Via SFTP or your server file manager, open app/design/frontend/<Vendor>/<Theme>/Magento_Theme/templates/root.phtml (for your custom theme) or the Magento_Theme module's root.phtml.
- Find <html and add <?= /* @escapeNotVerified */ $htmlAttributes ?> if it is already templated, or add lang="en" directly: <html lang="en">.
- For multi-store/multi-language setups, use the Magento locale resolver: inject the current locale as the lang value via a Block or ViewModel so each store view outputs its own language code.
- Deploy static content and clear the cache: bin/magento cache:clean, then verify with View Source.
What is html lang?
Every web page starts with an opening `<html>` tag. Adding a `lang` attribute to it — 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 one-line change in your theme or template, and it is one of the most foundational requirements of modern web standards. The value uses a standard two-letter (or extended) language code such as `en`, `fr`, `de`, `es`, `ja`, or `zh-Hans`.
Screen readers used by visually impaired shoppers rely on the `lang` attribute to choose the correct pronunciation engine — without it, your content may be read aloud in the wrong language, making your store inaccessible. Accessibility laws in many jurisdictions (ADA in the US, EN 301 549 in the EU, AODA in Canada) treat a missing `lang` attribute as a conformance failure, creating real legal exposure. Search engines also use this signal to understand which market a page targets, which influences how and where your pages appear in regional search results. Fixing it is a quick win that simultaneously reduces legal risk, improves usability for millions of shoppers with disabilities, and reinforces your international SEO targeting.
See the complete Html lang guide for every platform and the full background.
Not sure if your Adobe Commerce (Magento) store has this?
Run a free SEOLZ scan — we’ll find html lang and every other issue across your whole site.
Scan my site free