The Accept-Language header is an HTTP request header in which a browser or other client lists the human languages its user prefers, ranked by weight, so that a server can choose a suitable language version of a resource. In international SEO, it matters because sites often use it for automatic language detection, and that practice can hide language versions from search engine crawlers.
The header belongs to HTTP content negotiation, defined in the HTTP Semantics specification, and uses BCP 47 language tags such as en-US or de. It describes the user’s settings, not the user’s location, which makes it a more precise language signal than an IP address but still an unreliable basis for serving search engines.
How the Accept-Language header works
Each request from a browser typically carries a line such as Accept-Language: de-CH, de;q=0.9, en;q=0.7, fr;q=0.5. The browser builds this list from the language preferences in the browser or operating system, and the server may use it to select one representation among several. This process is called proactive, or server-driven, content negotiation.
Every entry can carry a quality value, written q, between 0 and 1 with up to three decimals. Entries without q default to a weight of 1, and a weight of 0 means the language is not acceptable. The table below breaks down the parts of a typical value.
| Component | Example | Meaning |
|---|---|---|
| Primary language subtag | de | German in any region |
| Region subtag | de-CH | German as used in Switzerland |
| Script subtag | zh-Hant | Chinese written in traditional characters |
| Quality value | q=0.7 | Relative preference from 0 to 1 |
| Wildcard | * | Any language not otherwise listed |
When a server honors the header, it should return a Content-Language header describing the chosen version and a Vary: Accept-Language header, which tells caches and content delivery networks that the response differs by requested language. Omitting Vary can cause a cache to serve one language to every visitor.
Why search engines rarely send Accept-Language
Search engine crawlers are not human users with language settings. Googlebot generally crawls without an Accept-Language header and mostly from IP addresses in the United States, so a server that negotiates language may always deliver its default version to the crawler. Other versions then remain uncrawled and unindexed.
For this reason, Google recommends separate URLs for each language version, connected by hreflang annotations, rather than locale-adaptive pages that change content on a single URL. Search engines can only rank what they can retrieve at a stable address, and a URL whose content depends on request headers offers no stable address for each language.
The comparison below places the header among other signals used in international targeting.
| Signal | Set by | What it indicates | Role for search engines |
|---|---|---|---|
| Accept-Language header | User’s browser | Preferred languages | Generally not used for ranking |
| Content-Language header | Server | Language of the response | Minor hint for some engines, not Google |
| hreflang annotations | Site owner | Alternate language and region URLs | Primary method for alternates |
| Geo-IP lookup | Server or CDN | Approximate visitor location | Risky when used for redirects |
| URL structure | Site owner | ccTLD, subdomain or subdirectory | Strong, stable targeting signal |
Safe and unsafe ways to use the header
Using Accept-Language is not wrong in itself; the risk lies in forced redirects and content swapping. The safest pattern is to keep every language version on its own crawlable URL and use the header only to suggest a more suitable version through a dismissible banner or a language selector.
| Pattern | User experience | SEO effect |
|---|---|---|
| Suggestion banner | User chooses and can dismiss | Safe, all versions remain crawlable |
| Redirect only on the homepage root | Fast routing for new visitors | Acceptable with an x-default page and hreflang |
| Forced redirect on all URLs | No access to other languages | Hides alternates from crawlers |
| Locale-adaptive content on one URL | Seamless for some users | Typically only one version gets indexed |
| Remembered manual choice | Respects explicit preference | Safe when stored in a cookie, not forced |
- Never redirect crawlers differently from users, because that resembles cloaking.
- Let an explicit user choice override the header, since many people browse with a default English setting.
- Return Vary: Accept-Language whenever the response truly varies by header.
- Keep the x-default URL neutral, for example a language selection page.
Common mistakes and how to diagnose them
Problems with the Accept-Language header usually surface as missing language versions in the index or users trapped in the wrong language. Diagnosis starts with requesting the same URL with and without the header, for example using curl with a custom header, and comparing status codes, redirects and the HTML lang attribute.
| Symptom | Likely cause | Fix |
|---|---|---|
| Only English pages indexed | Default version served when header is absent | Give each language its own URL |
| Wrong language in cached pages | Missing Vary header at the CDN | Add Vary or separate cache keys |
| Users cannot reach other versions | Forced redirect on every request | Replace with a banner and selector |
| hreflang errors in reports | Alternate URLs redirect elsewhere | Make alternates return status 200 |
| Mismatched language in snippets | Content swapped on a single URL | Stop locale-adaptive serving |
A frequent misconception is that the header reveals the visitor’s country. A tag such as en-US reflects a configured preference, often a factory default, so a traveler, an expatriate or a multilingual household can send values that contradict their location. Treat the header as a hint about language, never about geography.
Put simply
Every time a browser asks a website for a page, it quietly mentions which languages its user likes to read, in order of preference. That short note is the Accept-Language header.
A website can use the note to offer the right language, which is helpful. The trouble starts when a site forces everyone into one language automatically. Search engine robots usually do not send the note at all, so they may only ever see one version. The best approach is to suggest, not force, and to give every language its own web address.
In practice
An outdoor equipment retailer runs a site in English, German and French on separate subdirectories. A developer adds a rule that redirects every visitor to the version matching the first entry in their Accept-Language header. Within six weeks, the German and French sections lose most of their impressions, because the crawler, which sends no header, is redirected to English pages from every alternate URL.
The SEO team removes the forced rule, keeps all three versions reachable at their own URLs, and adds a dismissible banner that suggests the matching language. They also correct the hreflang annotations and set the language selector page as x-default. After recrawling, the German and French pages return to the index, and non-English organic clicks recover to earlier levels within about two months.