What AuditX checks
The scan reads the lang value on the html tag of the page you scanned and every og:locale meta tag on it. Both are read as a language code with an optional script and country, and the first part is compared. A few codes count as the same language: iw is he, ji is yi, in is id, and nb and nn are no. The result is an info note, which does not lower the score, when the page has no og:locale tag, or when the html lang value or the og:locale value cannot be read as a language code. It passes when any og:locale tag names the same language as the html tag. The country part is not compared, so en-GB with en_US passes. When the languages differ, the scan takes the first readable og:locale, removes scripts and styles from the body text, and checks the writing system of the page text, which needs at least 200 letters. If the html lang value does not fit that writing system and the og:locale does, the result is an info note that blames the html lang value, which another check reports. In every other case it warns, and the message names both languages. A warning counts toward the SEO score at 40 percent of what a fail would cost. The scan reads the page as fetched and does not look at og:locale:alternate tags.
Why it matters
The Open Graph protocol defines og:locale as the locale the tags are marked up in, in the format language_TERRITORY, with en_US as the default. A theme that never sets it leaves the default in place on a translated page.
W3C says the lang attribute specifies the natural language of the content of a web page. When og:locale names another language, one of the two statements about the same page is wrong.
How to fix it
- Open the page source and find the og:locale line. Compare it with the lang value on the html tag.
- Set og:locale to the language and country of the page, for example nl_NL or en_GB. In an SEO plugin, look for the site language or locale setting.
- On a site with several languages, give each translation its own og:locale. Do not copy one value to every page.
- If the html lang value is the wrong one, correct that instead, and keep og:locale as it is.
<html lang="nl-NL">
<meta property="og:locale" content="nl_NL">
Does your site pass this check? A free scan runs it with every other check and shows the result in about a minute.
Scan my site