Cloaking

On this page 7

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.

SignalHow it is usedWeakness
User-agent stringMatches names such as Googlebot or BingbotEasy to spoof and easy for engines to test
IP address rangesCompares the IP with known crawler networksEngines also crawl from unannounced addresses
HTTP referrerShows different content to visitors from search resultsLeaves an inconsistent trail across sessions
JavaScript executionHides content from clients that render scriptsModern crawlers render JavaScript
Accept-Language or cookiesAlters content for clients without cookiesCrawlers often arrive without cookies, exposing the split
Signals used to separate crawlers from users

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.

PatternWhat the crawler seesWhat the user sees
Keyword-stuffed text versionLong, optimized text pageThin page, images or a sales funnel
Sneaky redirectA relevant articleA redirect to an unrelated or affiliate site
Hacked content injectionSpam links and pharmaceutical keywordsThe normal, unchanged website
Topic switchContent about a harmless subjectGambling, adult or scam content
Hidden-text variantText in the HTML sourceThe same text hidden by CSS or scripts
Typical cloaking patterns

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.

PracticeStatusReason
Dynamic serving for mobileAcceptableSame content, different layout, with a Vary header
Geotargeted or translated pagesAcceptableCrawler treated like a user from the same location
Flexible sampling for paywallsAcceptablePaywall marked with structured data for subscription content
A/B testingAcceptable if temporaryCrawler sees a variant users also see, with canonical tags
Crawler-only text pageCloakingContent exists only to influence rankings
Redirect for search visitors onlyCloakingSearch result promises content the user never gets
Cloaking versus acceptable practices

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.

SymptomLikely causeRecommended action
Spam keywords in search snippetsHacked content injectionClean the site and close the security hole
URL Inspection shows a different pageUser-agent or IP rules on the serverRemove crawler-specific rules
Manual action in Search ConsoleConfirmed cloaking or sneaky redirectFix all instances and request reconsideration
Mobile users redirected to other domainsMalicious script or ad networkAudit third-party scripts and redirects
Diagnosing suspected cloaking

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.