An exporter shows a German buyer the German version of its website. Choosing "Deutsch" in the language menu switches the page to German, but the address in the browser bar never changes, and in Google Search Console the German page never gets indexed. This is a hypothetical example, but it is a pattern we see again and again on export sites: the visitor can change the language, while the search engine cannot. The usual culprit is a cookie stored in the browser or a session value kept on the server. In this guide we explain why the problem happens, how to recognise its symptoms, and what to change. For the wider picture, start with our guide to international site architecture.
Key Takeaways
- A language preference stored in a cookie or session does not make the same address show different content to Googlebot, because Google's crawling does not carry that state.
- Every language version needs its own publicly reachable, linkable URL, such as /de/ or /en-us/.
- The language switcher should use real links (a href). A button that only changes the language in JavaScript leaves no crawlable path to the other versions.
- Avoid forced redirects based on browser language. A dismissible suggestion is the safer pattern.
- Build hreflang tags that point to your real URLs and link back to each other with return tags.
Symptom: the visitor switches the language, Google does not see it
The first sign of this problem usually shows up in the indexing reports in Search Console. Pages are being crawled, but the language versions you expected do not appear in search results. The team checks the site and everything looks fine, because the switcher works perfectly in a normal browser. The real issue is that the search engine never gets to make that choice.
Common symptoms
- The English or German version never appears in search results; the Turkish home page is shown for every query.
- When the language is changed with the switcher, the address in the browser bar stays exactly the same.
- After clearing cookies and reopening the site, the language jumps back to Turkish every time.
- Duplicate page or "Google chose a different canonical" type warnings keep accumulating in Search Console.
- Hreflang tags are present in the code, yet the alternate pages are never confirmed by Google.
If you see several of these at once, it is reasonable to suspect that language selection is happening through a cookie or session rather than through the address. The sections below show how to confirm that and how to fix it step by step.
What is cookie- or session-based language switching?
Cookie- or session-based language switching means the language the visitor picks is stored either in a browser cookie or in the user's server-side session. On every request the server reads that value and produces the content accordingly. For the visitor this feels seamless: you choose once, and the site remembers. But when the address does not change, the same URL delivers different content depending on who asks, and a search engine has no reliable way to know which language that URL is meant to represent.
This approach shows up in three main forms: a language cookie (for example a value such as "lang=de"), a session value kept on the server, and automatic selection based on the Accept-Language header sent by the browser. All three produce the same outcome: the content changes while the address stays fixed. The table below compares them.
| Method | Visitor experience | What Googlebot sees | Result |
|---|---|---|---|
| Language cookie | Choice is remembered | No cookie, default language | Only the default version gets indexed |
| Session value | Choice lasts for the session | A new session, default language | Other language versions stay invisible |
| Automatic redirect via Accept-Language | Visitor lands in their browser language | Crawling typically runs with a fixed language and location | A single version gets crawled |
| URL-based language (/de/, /en-us/) | Links can be shared and bookmarked | Each version is a separate address | Each version can be indexed |
Why Google cannot see cookie- or session-based languages
The technical root of the problem lies in how search engines fetch pages. A crawler that does not behave like a person in a browser does not carry your preferences or your logged-in session. The three subsections below cover the most frequent causes.
Every crawl request starts clean
Google does not keep the persistent cookies and session state a human browser would keep. Google's JavaScript SEO documentation also notes that Googlebot clears local and session storage between page loads. The practical consequence is simple: when you switch the site to German, that choice is saved only in your browser. Googlebot's browser has no such record, so it receives the default Turkish version. Unless the German version has its own address, there is nothing for Google to index as the German page.
Automatic redirects lock the crawler into one version
Sending visitors to a language based on their browser setting or IP address can look like good user experience. Google's guidance for multi-regional and multilingual sites, however, recommends avoiding automatic redirects based on location or language, and making sure every language version is reachable through links. If the crawler is redirected, it may never visit the other versions at all. The site then presents a single language to a search engine that does not know the others exist.
Client-side language switching with no addresses
On some sites the language change happens entirely in the browser. The visitor clicks a button, the text is swapped by JavaScript, and the address stays the same. Each language then lives inside the same HTML shell, with no address of its own. Google may render the page, but because the versions do not have separate addresses, each one cannot be indexed as its own result. When the switcher is a button rather than a link, the crawler also has no path to follow to the other versions.
Symptom, cause and fix at a glance
The table below links what you observe to the most likely cause and the first fix to apply. A single symptom can have more than one cause, so work through the fixes in order of impact.
| Symptom | Likely cause | Fix |
|---|---|---|
| German version never gets indexed | Language changes only with a cookie | Create a separate, stable URL for each language |
| Switcher changes the page, address stays the same | Selection runs through JavaScript or the session | Turn the language options into real links with a href |
| Foreign visitors always land on the Turkish version | Forced redirect based on Accept-Language | Show a dismissible suggestion and remove the forced redirect |
| Hreflang is correct on paper but has no effect | Hreflang points to one address or to addresses that the switcher overrides | Point hreflang only to real, reciprocal URLs for each version |
| Duplicate page warnings in Search Console | All languages share one URL | Move each version to its own address and give each its own canonical |
Fix 1: Give every language version its own URL
The core fix is to make the language part of the address. For example, the Turkish home page can live at /, the English version at /en/, and the German version at /de/. The exact structure, and whether a subdirectory or a country domain suits you better, depends on your markets and resources. For a deeper look at how to set up language folders, read our guide to language-country folders.
- Choose a fixed address for each language and avoid changing it after publication.
- Serve each page's version in that language as its own HTML response, so the server picks the version from the address, not from a cookie.
- Point the language switcher links at these fixed addresses.
- Give each version a canonical tag that refers to itself, not to another language.
- Include every language version in your XML sitemap.
Here is a hypothetical example. A machinery exporter publishes the English and German versions of its Turkish hydraulic press page at /en/products/hydraulic-press and /de/produkte/hydraulische-presse. In the old setup, the same address changed with a language cookie, and only the Turkish version was indexed. In the new setup, each version has its own address, so the search engine can crawl and evaluate each one. This is an illustration only; actual results depend on the site's structure, content and crawl frequency.
Fix 2: Turn the language switcher into real links
When the switcher is a real a href link, the search engine can follow it and reach the target page. When it is a button that runs JavaScript, there is no path to the other versions. The switcher should therefore contain links that point to the full address of the matching page in each language. Keeping a language cookie to remember the visitor's choice is not a problem in itself, but the address, not the cookie, must be the main source of the content.
When a visitor switches language, send them to the equivalent of the page they are on, not to the home page. Sites that rely on a language parameter such as ?lang= carry their own risks, which we cover in our article on language parameters.
Internal links between language versions are a separate decision: which pages should link across languages, and which should stay within their own language? We discuss the criteria in our article on cross-language internal linking.
Fix 3: Build hreflang on real URLs
Hreflang tells search engines which language and region a page is meant for. Google's documentation expects each language version to be referenced by a valid, reachable URL, and the versions to link back to each other, which is what return tags are for. On sites where language changes through a cookie, hreflang usually points at a single address, which makes the tags ineffective. To find and fix reciprocal tag errors, see our guide to hreflang return tag errors.
For the broader framework, the international SEO guide on hreflang errors is a useful companion. x-default also comes up at this point, but it does not mean automatic language selection. It only names the page to show when no matching language version exists, so it cannot replace a proper URL structure.
Fix 4: Use a suggestion instead of a forced redirect
Instead of forcing visitors into a language, you can show a small, dismissible suggestion when the browser language differs from the page language: "Would you like to see the German version?" This leaves the choice with the user and keeps every version reachable for crawlers. The suggestion should be easy to close and should not return on every page. The preference can be saved, but the content should still be determined by the address.
If you do need a redirect, limit it to a narrow case with explicit user consent, and think carefully about the risk that the crawler sees only one version. Structures that let visitors switch freely between clear addresses are the least risky for both people and search engines.
Step-by-step check: does your site have this problem?
The five steps below help you quickly confirm whether a site has cookie- or session-based language switching. Start with one page, then apply what you learn to other page types.
- Clear cookies and local storage in your browser, then open the site in a new private window. If the language changes but the address does not, the problem is most likely cookie-based.
- Switch the language with the switcher and watch the browser address bar. If it does not change, the versions do not have their own addresses.
- Inspect the page source to see whether the language options are a href links or buttons.
- In Search Console, run the URL Inspection tool on the German or English page address and check which canonical Google has chosen.
- Send requests with different Accept-Language headers to your server. If the response changes while the address stays the same, the site is selecting the language automatically.
Record your findings in a table by page type. Prioritise commercial product and category pages and high-traffic content first. Use the same table after the fixes to track the change.
Common mistakes
Teams fall into the same traps again and again while fixing this problem. Knowing them in advance can save you from repeating the cycle.
- Switching languages only with JavaScript while keeping the address fixed. This is the most common reason the other versions stay invisible to search engines.
- Keeping all versions under one address and trying to compensate with hreflang, when the real fix is separate addresses.
- Giving every language the same canonical address, for example pointing the English and German versions to the Turkish home page.
- Adding hreflang only on the Turkish version. Without reciprocal tags on the other versions, the alternate pages cannot be confirmed.
- Using a flag icon as the only switcher element with no underlying link.
Conclusion and next step
Switching language with a cookie or a session feels practical to visitors, but for search engines the language belongs to the address. A stable URL for each language, real links in the switcher and correctly built hreflang will solve the problem. Start by running the checks above on your current site to see which pages are affected, then order the fixes by business value. If you are planning the language structure of a site from scratch, reviewing your language and URL decisions together is the most reliable starting point.




No comments yet
Leave a Comment