Content-Language header

On this page 7

The Content-Language header is an HTTP response header that declares the natural language or languages of the intended audience of a document, expressed as one or more BCP 47 language tags such as en-US or de. In international SEO, it is one of several ways a server can describe the language of a page, alongside the lang attribute on the HTML element and hreflang annotations.

Its practical weight in search is modest. Google ignores the header for language and regional targeting, while Bing treats it as a supporting signal. Experienced practitioners therefore configure it correctly for consistency and for engines that read it, but never rely on it as the primary mechanism for serving the right page to the right market.

How the Content-Language header works

The header is sent by the server with each response and describes the audience language, not the encoding. A typical line reads Content-Language: fr-CA, which tells clients that the content is meant for French speakers in Canada. The semantics are defined in RFC 9110, the current HTTP semantics specification, which replaced the older RFC 7231 wording without changing the meaning.

The value is a comma-separated list of language tags. A single tag is the norm; multiple tags indicate that the document is intended for speakers of several languages, for example a bilingual legal notice. The header does not imply that every part of the text is in the listed language, and it says nothing about the region of the server or the currency of prices.

The following table breaks down the parts of a language tag as used in the header value.

SubtagExampleStandardMeaning
Languageen, pt, zhISO 639-1 or 639-3Primary language, required
ScriptHant, LatnISO 15924Writing system, optional
RegionUS, BR, 419ISO 3166-1 or UN M.49Regional variant, optional
Variant1996IANA registrySpelling or dialect variant, rare
Structure of a BCP 47 language tag

How search engines treat the header

Search engines differ sharply in how much weight they give to Content-Language. Google determines page language from the visible text itself and uses hreflang for alternate versions, so the header has no effect on its language or geotargeting decisions. Bing has publicly listed Content-Language, the HTML lang attribute and hreflang among the language signals it considers, and it may use the region subtag as a geotargeting hint.

Other regional engines rely mainly on content analysis and on their own webmaster tools. Because support is uneven and rarely documented in detail, the safe assumption is that the header is at best a tiebreaker, never a substitute for clear on-page language and correct alternate annotations.

SignalWhere it livesGoogleBing
Content-Language headerHTTP responseIgnoredSupporting signal
HTML lang attributeRoot html elementIgnored for rankingSupporting signal
Hreflang annotationHead, header or sitemapPrimary alternate signalConsidered
Visible page textBody contentPrimary language signalPrimary language signal
Meta http-equiv languageHead meta tagIgnoredConsidered, legacy
Language signals compared

The header belongs to a family of content negotiation mechanisms and is easy to confuse with its neighbors. The Accept-Language header travels in the opposite direction: the browser sends it to state the user’s preferred languages, and the server may use it to choose a variant. Content-Language is the server’s statement about the response it actually delivered.

When a server varies output by the visitor’s language preference, it should also send Vary: Accept-Language so that caches and CDNs store separate copies. Omitting this header is a classic cause of one language version being served to everyone after the first request is cached.

HeaderDirectionPurposeSEO relevance
Content-LanguageServer to clientDeclares audience languageWeak, Bing only
Accept-LanguageClient to serverStates user preferenceIndirect, risky if used for redirects
VaryServer to clientLists request headers that change outputPrevents cache mix-ups
Link with hreflangServer to clientPoints to alternate versionsStrong, read by Google
Headers involved in language handling

Configuring the header correctly

The header is usually set at the web server, CDN or application layer. In Apache it can be added with the Header set directive inside a directory or virtual host; in nginx with add_header; in most frameworks through response middleware. On multilingual sites the value must be set per URL or per language folder, never globally, otherwise every version claims the same language.

The decision table below summarizes recommended values for common international site setups.

Site setupRecommended valueReason
Single language, single marketen or en-GBSimple and consistent with lang
Language foldersPer folder, for example de under /de/Each version declares itself
Country domainsLanguage plus region, for example fr-BEMatches the market intent
Bilingual single pagefr-CA, en-CAAudience reads both languages
Language selector landing pageOmit or list all offered languagesNo single audience language
Recommended values by site setup

Keep the header, the HTML lang attribute and any hreflang annotation aligned to the same tag. Validate tags against the IANA subtag registry, because invented codes such as en-UK instead of en-GB or jp instead of ja are silently treated as unknown.

Limitations and common mistakes

The most frequent problems come from template-level defaults that nobody revisits after a site expands into new markets. Audits of international sites regularly find English declared on German pages, or a header that contradicts the hreflang cluster.

MistakeConsequenceFix
Global default valueAll versions claim one languageSet the value per locale
Invalid tag, such as en-UKSignal is discardedUse registered codes, here en-GB
Conflict with hreflangMixed signals for BingGenerate both from one locale map
Varying by Accept-Language without VaryWrong language cachedSend Vary: Accept-Language
Treating it as a ranking fixWasted effort on GooglePrioritize hreflang and content
Typical errors and their fixes
  • The header cannot localize content; translation quality and local relevance still decide performance.
  • Crawlers rarely send varied Accept-Language values, so language negotiation should never hide versions from bots.
  • Some CDNs strip or override custom headers, so verify the live response with a header inspection tool after deployment.

Explained without jargon

When a website sends a page to a browser, it also sends a few short notes about that page. The Content-Language header is one of those notes, and it simply says which language the page is written for, such as French for Canada.

Think of it as the label on a book’s spine saying which language is inside. Some search engines, like Bing, glance at the label. Google ignores it and reads the pages instead. The label helps a little, but the real work is done by the content and by hreflang, which links all language versions together.

A typical use case

A mid-sized outdoor equipment retailer runs one domain with folders for English, German and Polish. After launch, its Bing Webmaster Tools reports show German pages appearing for English queries. A technical audit finds that the server sends Content-Language: en on every URL, because the value was hard-coded in the shared template, while hreflang correctly marks the German folder as de.

The development team moves the value into the locale configuration, so the /de/ folder now returns de and the /pl/ folder returns pl, matching the HTML lang attribute and the hreflang map. Within the following crawl cycles, Bing stops surfacing German pages for English searches, while Google rankings remain unchanged, which confirms that the fix mattered for Bing alone and that hreflang had already been doing the work for Google.