SEO · Checked once per domain
Content-Language consistencyWhat it checks and how to fix it
What it checks
Compares the language the home page declares in three places: the <html lang> attribute, a <meta http-equiv="Content-Language"> tag and the Content-Language HTTP header. Fails when none of them is set, warns when they name different languages, and passes when they agree.
Why it matters
Search engines, browsers (for translation prompts and hyphenation) and screen readers (for pronunciation) all decide the page's language from these declarations. When they contradict each other, each tool picks a different one, and the page can be served to or read out in the wrong language.
How to fix it
Declare the language in the HTML, and if you also send a Content-Language header or meta tag, make it say the same
thing. Removing a stale meta tag is a valid fix too.
<html lang="en">
nginx:
add_header Content-Language "en" always;
Apache:
Header always set Content-Language "en"
Rails (per request, following the current locale):
class ApplicationController < ActionController::Base
after_action { response.headers["Content-Language"] = I18n.locale.to_s }
end
Cloudflare: add a Transform Rule (Modify Response Header) that sets Content-Language to the site's language.