On this page
What this issue is
The lang attribute sits on the opening <html> tag, for example <html lang="fr">. It declares the main language of the page. This issue happens when the declared language does not match the visible text, most often lang="en" left on a French page.
It usually comes from a theme or template built in English and then translated by hand or with a plugin, without the language setting being updated. WCAG 2.2 covers it under success criterion 3.1.1 (Language of Page). Criterion 3.1.2 (Language of Parts) covers passages in another language inside a page.
Why it costs you leads or sales
The impact is usually low, but real for some visitors. Screen readers choose a pronunciation voice from the lang value. French text read with English rules is hard to understand, so blind and low-vision visitors may leave before they reach your form or checkout.
Browsers also use the value. A wrong code can trigger a pointless translate prompt, or mess with hyphenation, quote styles and spell checking. Search engines mostly work out the language from the content itself, so treat this as an accessibility and quality fix rather than a ranking lever.
lang="en" on a French page
- Screen reader pronounces French words with English rules
- Browser may offer to translate a page that is already French
- Fails WCAG 3.1.1 in an accessibility audit
lang="fr" on a French page
- Screen reader switches to a French voice
- No false translate prompt
- Passes the language-of-page check
How to check if your site has it
View the page source
Open the French page, right-click and choose View page source. Look at the first lines for the <html> tag.
Or read it from the console
Open DevTools, go to Console and run document.documentElement.lang. It returns the value the browser sees, including changes made by JavaScript.
Compare with the visible text
The value should match the main language of the page. Check each language version separately, as only some may be wrong.
Run an accessibility checker
Tools such as Lighthouse (in Chrome DevTools) or axe DevTools flag a missing or invalid lang. A well-formed but wrong value like en on French text may need your own eye, so also check pages by hand.
console.log(document.documentElement.lang);
// Expected on a French page: "fr" (or "fr-FR", "fr-CA")How to fix it
Use a valid language code from the BCP 47 standard: a two-letter language code, optionally with a region, such as fr, fr-FR, fr-CA or fr-BE. Set it per page, not once for the whole site, if you run several languages.
Set the site language
Go to Settings > General > Site Language and choose Français. WordPress outputs language_attributes() in the theme, which prints lang="fr-FR".
Check the theme header
In header.php the tag should read <html <?php language_attributes(); ?>>. If a value like lang="en" is hard-coded, replace it with that call (use a child theme).
Multilingual plugins
If you use WPML, Polylang or TranslatePress, make sure the French language is set up with the right locale. These plugins change the lang value per page when the theme uses language_attributes().
Add the French language
Go to Settings > Languages and add French, then publish it. Most themes print the right code on each translated page.
Check theme.liquid
Open Online Store > Themes > Edit code > layout/theme.liquid. The tag should be <html lang="{{ request.locale.iso_code }}">. Replace any hard-coded lang="en".
Set the site language
Open Site settings > General (or Localization if you use it) and set the language. With Localization, each locale gets its own lang value.
Publish
Publish the site, then re-check the source of a French page.
Set the language
In a multilingual site, use Wix Multilingual and make sure each language version is assigned the correct language. For a single-language site, check the site language in Settings.
Re-check the source
Wix sets the attribute itself. If it is still wrong after publishing, contact Wix support, as you may not be able to edit the <html> tag.
Set the region and language
Go to Settings > Language & Region and choose French. Squarespace uses this for the page lang value.
Check the result
Publish and read document.documentElement.lang on a live page.
Edit the template
Change the <html> tag in your base layout so the value comes from the page's language, not a fixed string.
Mark foreign passages
For an English quote inside a French page, wrap it with lang="en" on that element only.
<!-- Main language of the page -->
<html lang="fr">
<!-- A passage in another language inside the page -->
<p>Notre slogan : <span lang="en">Just do it</span>.</p>How to confirm it's fixed
- document.documentElement.lang returns fr (or a fr-xx value) on French pages
- English pages still return en
- View source shows the right value, not only the rendered DOM
- Lighthouse accessibility audit has no lang errors
- A screen reader such as NVDA or VoiceOver reads the page with French pronunciation
- Chrome no longer offers to translate the French page
How to prevent it happening again
- Add a lang check to your launch checklist for every new language version
- Never copy an English template and translate only the text
- Generate the value from the page language instead of hard-coding it
- Run an accessibility scan after theme or plugin updates
- Re-check the value after changing your multilingual plugin
How FunnelGuard handles this
This issue is outside what FunnelGuard checks. FunnelGuard runs your customer journeys (forms, checkouts, bookings), tracking hits and lead delivery on a schedule. It does not audit the HTML language attribute. The kind of tool that fits is an accessibility checker or code linter, such as Lighthouse, axe DevTools or WAVE, which read the page markup and test it against WCAG rules.
FunnelGuard is still useful for the revenue side of the same pages: it can tell you whether the French lead form still submits and the tracking still fires after you change templates.
Questions people ask
Why is my French page marked as English?
Your theme or template probably has lang="en" in the <html> tag, and the French content was added without updating it. Change it to lang="fr" in the theme or the site language setting.
What does the lang attribute do on an HTML page?
It tells browsers, screen readers and other tools what language the page is written in. Screen readers use it to pick the right voice and pronunciation, and browsers use it for translation prompts, spell checking and hyphenation.
How do I change the lang attribute in WordPress?
Go to Settings > General > Site Language and choose the language. The theme prints it through language_attributes() in the <html> tag. If the theme hard-codes lang="en", edit header.php in a child theme.
Does a wrong lang attribute hurt SEO?
Not directly in most cases, because search engines detect the language from the visible text. Use hreflang for language targeting. The wrong lang value is mainly an accessibility and user-experience problem.
Should I use fr or fr-FR in the lang attribute?
Both are valid. Use fr if the page suits all French speakers, and fr-FR, fr-CA or fr-BE if the wording is specific to a region. Pick one and use it consistently.
How do I mark a few English words on a French page?
Add lang="en" to the element that wraps those words, for example <span lang="en">Just do it</span>. The page lang stays fr, and screen readers switch voice for that passage.
Can FunnelGuard detect a wrong lang attribute?
No. This is outside what FunnelGuard checks. Use an accessibility tool such as Lighthouse, axe DevTools or WAVE to find it.