Cloaking is the practice of serving different content or URLs to search engine crawlers than to human users, with the aim of manipulating how a page is indexed and ranked. In SEO, it is one of the oldest black hat techniques and is explicitly listed as spam in Google Search Essentials and in the webmaster guidelines of Bing.
The defining element is intent to deceive: the search engine evaluates one version of a page, while visitors who click the result receive something else. Legitimate content variation, such as language selection or mobile layouts, is not cloaking as long as crawlers and users receive equivalent content.
How cloaking detects and splits visitors
Cloaking works by identifying the requester before the server decides which response to return. The server, a script or an edge rule inspects request signals, classifies the visitor as a crawler or a human and then delivers the matching version of the page.
The table below lists the most common detection signals and why each one is unreliable for honest use.
| Signal | How it is used | Weakness |
|---|---|---|
| User-agent string | Matches names such as Googlebot or Bingbot | Easy to spoof and easy for engines to test |
| IP address ranges | Compares the IP with known crawler networks | Engines also crawl from unannounced addresses |
| HTTP referrer | Shows different content to visitors from search results | Leaves an inconsistent trail across sessions |
| JavaScript execution | Hides content from clients that render scripts | Modern crawlers render JavaScript |
| Accept-Language or cookies | Alters content for clients without cookies | Crawlers often arrive without cookies, exposing the split |
The response split can be server-side, where a different HTML document is returned, or client-side, where scripts swap, hide or redirect content after the crawler has read the initial markup. Both forms produce the same violation because the indexed content no longer matches the user experience.
Common forms of cloaking
Cloaking appears in several recognizable patterns, all of which create a mismatch between indexed and visible content. Some patterns are deliberate spam campaigns, while others result from compromised websites.
| Pattern | What the crawler sees | What the user sees |
|---|---|---|
| Keyword-stuffed text version | Long, optimized text page | Thin page, images or a sales funnel |
| Sneaky redirect | A relevant article | A redirect to an unrelated or affiliate site |
| Hacked content injection | Spam links and pharmaceutical keywords | The normal, unchanged website |
| Topic switch | Content about a harmless subject | Gambling, adult or scam content |
| Hidden-text variant | Text in the HTML source | The same text hidden by CSS or scripts |
Hacked-site cloaking is particularly damaging because the owner, who visits the site as a normal user, often sees nothing wrong. The problem typically surfaces only through a Search Console security notice, unexpected search snippets or a sudden ranking drop.
Cloaking compared with legitimate content variation
Not every difference between versions counts as cloaking. Search engines accept variation that serves the user and keeps the substance of the page the same for everyone, including the crawler. The test is whether a crawler and a comparable user would receive equivalent primary content.
| Practice | Status | Reason |
|---|---|---|
| Dynamic serving for mobile | Acceptable | Same content, different layout, with a Vary header |
| Geotargeted or translated pages | Acceptable | Crawler treated like a user from the same location |
| Flexible sampling for paywalls | Acceptable | Paywall marked with structured data for subscription content |
| A/B testing | Acceptable if temporary | Crawler sees a variant users also see, with canonical tags |
| Crawler-only text page | Cloaking | Content exists only to influence rankings |
| Redirect for search visitors only | Cloaking | Search result promises content the user never gets |
Cloaking also differs from a doorway page, which is a separate low-value page built to rank and funnel users elsewhere. The two often appear together, but a doorway page shows the same content to everyone, whereas cloaking depends on showing two versions of one URL.
Detection and penalties
Search engines detect cloaking by comparing responses across different crawl conditions, for example by fetching a page with an unannounced user agent, from different IP ranges or with full rendering. Automated spam systems flag inconsistencies, and human reviewers confirm suspicious cases.
The consequences range from algorithmic demotion to a manual action for cloaking or sneaky redirects, which can affect individual pages or the entire domain. Recovery requires removing every cloaked variant, checking server and CDN rules and submitting a reconsideration request that explains the cause and the fix.
The table below connects typical symptoms to likely causes and the appropriate response.
| Symptom | Likely cause | Recommended action |
|---|---|---|
| Spam keywords in search snippets | Hacked content injection | Clean the site and close the security hole |
| URL Inspection shows a different page | User-agent or IP rules on the server | Remove crawler-specific rules |
| Manual action in Search Console | Confirmed cloaking or sneaky redirect | Fix all instances and request reconsideration |
| Mobile users redirected to other domains | Malicious script or ad network | Audit third-party scripts and redirects |
Accidental cloaking and how to prevent it
Some sites create unintentional cloaking through technical misconfiguration rather than intent. Search engines usually judge the outcome, so even accidental mismatches can harm visibility if they persist.
- Bot-protection rules on a CDN may serve crawlers a challenge page or a stripped version of the content.
- Prerendering services can deliver stale or incomplete snapshots to crawlers while users see the current page.
- Personalization layers may hide main content from clients without cookies, which includes most crawlers.
- Interstitials and consent walls that block the main content for users but not for crawlers create a misleading search result.
A reliable safeguard is to compare the rendered HTML from the URL Inspection tool with what a normal browser displays, and to repeat this check after every change to server, CDN or rendering configuration.
The simple explanation
Cloaking is like a shop that shows an inspector a clean, well-stocked display, but then shows real customers a completely different, much worse shelf. The inspector writes a good report, and customers are misled.
On the web, the inspector is the search engine. A cloaking website shows search engines one page and people another. Search engines treat this as cheating and can remove such sites from their results.
How it is used in practice
An SEO consultant is hired by a mid-sized online furniture retailer whose organic traffic fell by roughly 60 percent within two weeks. In Search Console, she finds a manual action for cloaking, and the URL Inspection tool shows category pages filled with casino keywords that never appear in a normal browser.
Server logs reveal that an outdated plugin had been compromised and a script was serving spam content only to requests with crawler user agents. The team removes the script, updates every plugin, rotates credentials and verifies that crawlers and users now receive identical pages. After a reconsideration request describing these steps, the manual action is lifted within about three weeks, and rankings gradually recover over the following two months.