# Eliminate deceptive cloaking

- Check 47.03 · Practices to avoid · Critical
- Source: https://checklist-seo-geo.com/en/practices-avoid/eliminate-deceptive-cloaking
- Detect and remove cloaking: content or redirects that change by crawler, referrer or IP, on Apache, Nginx, Cloudflare, AWS, WordPress or Next.js.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/practices-avoid/eliminate-deceptive-cloaking.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

Cloaking means serving search engines different content from what visitors see, in order to manipulate rankings. It works by reading the request's user agent, IP address or referrer. Google lists it among the most serious spam practices. This check consists in making sure that no rule in the server, the CDN, the CMS or the application treats crawlers separately, and removing those that do. Expected result: for the same URL, Googlebot, Bingbot, AI crawlers and a visitor receive the same main content.

## Why it matters

Google's spam policies define cloaking as presenting different content to users and search engines with the intent to manipulate search rankings and mislead users. Two examples are given: a page about travel destinations shown to search engines and a page about discount drugs shown to users, or keywords inserted only when the requester is a search engine. Sneaky redirects, which send the visitor somewhere other than the page the crawler saw, are treated the same way.

The consequences range from demotion to the “Cloaking and/or sneaky redirects” manual action, or even “Major spam problems” when cloaking is combined with other abuse. Cloaking is not always intentional: a hacked site often serves it so that its owner sees nothing, showing the spam only to crawlers or to visitors coming from Google.

For generative engines, the stakes are the same: an assistant that summarizes or cites a page must describe what the visitor will find on clicking. Serving AI crawlers a special version falls under the check [eliminate misleading content aimed at bots](https://checklist-seo-geo.com/en/practices-avoid/eliminate-misleading-content-aimed-at-bots).

## What it improves

- **Compliance**: removes one of the heaviest causes of manual action.
- **Security**: looking for conditional rules often reveals a hack.
- **Reliable indexing**: what Google indexes and displays matches what the visitor finds.
- **Consistent AI citations**: assistants describe the real page. No guarantee of citation.
- **Maintenance**: a single version of each page to test and evolve.

## How to check

**1. Compare responses by user agent.** This script saves the page as seen by a browser, by Googlebot, by Bingbot and by an AI crawler, then shows the HTTP code, size, final URL and title:

```bash
URL="https://example.com/"
test_ua() {
  curl -s -L -A "$2" -o "$1.html" -w "$1 : %{http_code} %{size_download} bytes %{url_effective}\n" "$URL"
  grep -o -i '<title>[^<]*' "$1.html"
}
test_ua navigateur "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0 Safari/537.36"
test_ua googlebot "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
test_ua bingbot "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
test_ua gptbot "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.1; +https://openai.com/gptbot)"
diff <(sed 's/<[^>]*>//g' navigateur.html | tr -s ' \n') <(sed 's/<[^>]*>//g' googlebot.html | tr -s ' \n') | head -40
```

Acceptable small differences: security tokens, timestamps, ad blocks. Alarming differences: a different title, paragraphs or links present on one side only, a different final URL.

**2. Compare by referrer.** Some hacks only redirect visitors coming from a search engine:

```bash
curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" https://example.com/
curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" -e "https://www.google.com/" https://example.com/
```

Both lines must be identical. Run the test again with a smartphone user agent: sneaky redirects often target mobile.

**3. See what the real Googlebot receives.** IP-based cloaking escapes the previous tests, since your requests come from your own address. In the [URL Inspection tool](https://search.google.com/search-console/inspect), click “Test live URL”, then “View tested page”: compare the HTML tab and the screenshot with the page shown in your browser. This is the method Google gives for handling this manual action.

**4. Check the reports.** [Manual actions](https://search.google.com/search-console/manual-actions) and “Security issues” in Search Console; in Google, a `site:example.com` search that brings up titles in a foreign language or products you do not sell betrays content served to crawlers only.

Compliant result: the same codes, the same titles, the same final URLs and the same main content for every agent; the page tested by Google is identical to yours.

## How to implement

### Before you start

Adapting a page to the device, the language or the subscription is not cloaking as long as crawlers are treated like a visitor of the same type:

| Situation | Verdict | Condition |
|---|---|---|
| Dynamic rendering (prerendered version for crawlers) | Tolerated | Similar content; Google presents it as a workaround it does not recommend |
| Paid content (paywall) | Allowed | Google sees the full content and paywalled content markup is in place |
| A/B test | Allowed | Googlebot is not sent to a variant chosen for it; 302 redirect and `rel="canonical"` to the original |
| Adapting to country or language | Allowed with care | Googlebot is treated like a visitor from its apparent country; avoid automatic redirection based on the assumed language |
| Anti-bot challenge lifted for verified crawlers | Allowed | The page served behind it is the same |
| Text, links or title added for crawlers only | Prohibited | Remove |
| Redirecting only visitors coming from Google | Prohibited | Remove and look for a hack |

Before changing anything, back up the configuration files and record each conditional rule you find: its location, its condition (user agent, IP, referrer, country), its effect.

### Apache

Versions: Apache 2.4.

Look for user agent and referrer conditions in the configuration and the `.htaccess` files:

```bash
sudo grep -rn -i -E "HTTP_USER_AGENT|HTTP_REFERER|BrowserMatch|SetEnvIf.*User-Agent" /etc/apache2/ /etc/httpd/ /var/www/ --include="*.conf" --include=".htaccess" 2>/dev/null
```

Example of cloaking rules to remove, typical of a hack or of old-school “SEO”:

```apache
RewriteCond %{HTTP_USER_AGENT} (googlebot|bingbot|gptbot) [NC]
RewriteRule ^(.*)$ /version-robots/$1 [L]

RewriteCond %{HTTP_REFERER} (google|bing)\. [NC]
RewriteRule ^(.*)$ https://site-tiers.example/ [R=302,L]
```

A rule that returns `403` to a malicious bot is not cloaking: it blocks access without changing the content. Reload after the fix:

```bash
sudo apachectl configtest && sudo systemctl reload apache2
```

### Nginx

Versions: Nginx 1.24 and later.

```bash
sudo grep -rn -E '\$http_user_agent|\$http_referer|\$geoip' /etc/nginx/
```

Inspect each `map` block and each `if` you find. Remove those that change the root, rewrite the URL or add content depending on the crawler:

```nginx
# To remove
map $http_user_agent $root_dir {
    default            /var/www/site;
    ~*(googlebot|bingbot) /var/www/site-robots;
}
```

```bash
sudo nginx -t && sudo systemctl reload nginx
```

### Cloudflare

Versions: Cloudflare dashboard, all plans, November 2026.

- **Workers**: open [Workers & Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) and review each Worker attached to a route on the domain. Search the code for `User-Agent`, `cf.botManagement` and `Referer`: a Worker that rewrites the response for crawlers is cloaking.
- **Rules**: from the [Rules overview](https://dash.cloudflare.com/?to=/:account/:zone/rules/overview), open the redirect, transform and origin rules. An expression that uses `http.user_agent`, `cf.client.bot` or `http.referer` to change the URL, the origin or the content must be removed.
- **Legitimate case**: `cf.client.bot` in a security rule, to exempt verified bots from a challenge, does not change the page served.

Then purge the cache: [`Caching > Configuration`](https://dash.cloudflare.com/?to=/:account/:zone/caching/configuration), “Purge Everything”.

### AWS

Versions: AWS console, November 2026.

On **CloudFront**, open the distribution, `Behaviors` tab, and note the associated functions (CloudFront Functions and Lambda@Edge). Review their code: a function that picks the origin or rewrites the URI based on the `User-Agent` header must be fixed. The `CloudFront-Is-Mobile-Viewer` header, used to adapt the layout, is legitimate if Googlebot Smartphone receives the mobile version like a smartphone. Run a `/*` invalidation after the fix.

### Shared hosting

On cPanel, Plesk or shared hosting, cloaking almost always comes from a hack: a modified `.htaccess`, a PHP file added to an images folder, `auto_prepend_file` in a `.user.ini`. Apply the search from the Apache section to the `.htaccess` file of each folder, run the hosting provider's malware scanner and change every access password (FTP, database, administration).

### WordPress

Versions: WordPress 6.4 and later, WP-CLI 2.x.

```bash
wp core verify-checksums
wp plugin verify-checksums --all
grep -rn -i -E "HTTP_USER_AGENT|googlebot|HTTP_REFERER" wp-content/plugins wp-content/themes wp-content/mu-plugins | grep -v "/vendor/" | head -50
```

Check the `wp-content/mu-plugins` folder, which the Plugins screen does not list like the others. Remove any plugin presented as able to “serve an optimized version to search engines”. Cache plugins that serve a different version to crawlers must serve the same content. For a hacked site, follow [monitor for hacking and content or link injection](https://checklist-seo-geo.com/en/security-infrastructure/monitor-hacking-content-link-injection).

### Laravel

Versions: Laravel 11 to 13.

```bash
grep -rn -i -E "userAgent\(\)|User-Agent|isCrawler|CrawlerDetect" app/ routes/ bootstrap/ config/
```

A middleware that detects a crawler to record statistics or apply a rate limit is legitimate. A middleware that changes the view, the content or the redirect for a crawler is not: remove the conditional branch and serve the same response to everyone.

### Next.js

Versions: Next.js 15 and 16 (App Router).

Open `proxy.ts` (named `middleware.ts` before Next.js 16) and search for `userAgent(` or `isBot`. The `userAgent()` helper from `next/server` exposes an `isBot` boolean: if it is used to rewrite the URL or to pick different content for crawlers, remove the branch.

```ts
// To remove from proxy.ts
import { NextResponse, userAgent } from "next/server";
import type { NextRequest } from "next/server";

export function proxy(request: NextRequest) {
  if (userAgent(request).isBot) {
    return NextResponse.rewrite(new URL("/version-robots", request.url));
  }
  return NextResponse.next();
}
```

If the application needs a rendering that is readable without JavaScript, switch to server-side or static rendering rather than to a version reserved for crawlers.

### Requesting a review

If a manual action is in progress, fix all the affected pages, then click “Request Review” in the report. Google asks you to explain the problem, the steps taken and their results. Processing usually takes from a few days to a few weeks. See [check manual actions](https://checklist-seo-geo.com/en/security-infrastructure/check-manual-actions).

## Common mistakes

- **Testing only with curl**: IP-based cloaking can only be seen with Search Console's URL Inspection.
- **Keeping dynamic rendering out of habit**: it is tolerated if the content is similar, but Google now recommends server-side or static rendering.
- **Redirecting Googlebot to a “default” language** while visitors are redirected by country: that is separate treatment.
- **Letting an A/B test run indefinitely**: Google states that an unnecessarily long test may be interpreted as an attempt to deceive search engines.
- **Removing the rule without looking for the vulnerability**: a hacked `.htaccess` gets rewritten at the next intrusion.
- **Forgetting AI crawlers**: a special version for GPTBot or PerplexityBot raises the same trust problem.

## Frequently asked questions

### Is dynamic rendering considered cloaking?

Google does not consider dynamic rendering to be cloaking as long as the version served to crawlers is similar to the one visitors get. However, it presents it as a workaround, not a long-term solution, and recommends server-side rendering, static rendering or hydration instead. Using it to serve completely different content to crawlers is still cloaking.

### Is a paywall a form of cloaking?

A paywall is not cloaking if Google can see all the content behind the paywall, like a subscriber, and if the site follows Google's guidance on flexible sampling. Publishers must also add paywalled content markup, which indicates which part is restricted. Without this markup, the gap between what Googlebot and the visitor see may be treated as cloaking.

### Can I redirect visitors by country without cloaking?

Yes, as long as Googlebot is treated like a visitor from the country it appears to come from, with no exception made for it. Google crawls mostly from US addresses and advises against automatic redirection based on the assumed language, because some versions may never get crawled. Prefer a crawlable language selector and hreflang tags to a forced redirect.

### How do I know whether my site is cloaking without my knowledge?

Compare the page received with a browser user agent, a Googlebot one and a smartphone one, then with a Google referrer. Then use Search Console's URL Inspection, which shows the HTML received by the real Googlebot. A different title, unknown links or a redirect specific to one case often reveal a hack. Also check the Manual actions and Security issues reports.

## Resources

- [Google Search Central: spam policies, cloaking](https://developers.google.com/search/docs/essentials/spam-policies?hl=en#cloaking) and [sneaky redirects](https://developers.google.com/search/docs/essentials/spam-policies?hl=en#sneaky-redirects)
- [Search Console Help: Manual actions report](https://support.google.com/webmasters/answer/9044175?hl=en)
- [Google Search Central: dynamic rendering as a workaround](https://developers.google.com/search/docs/crawling-indexing/javascript/dynamic-rendering?hl=en)
- [Google Search Central: minimizing the impact of A/B testing](https://developers.google.com/search/docs/crawling-indexing/website-testing?hl=en)
- [Google Search Central: structured data for paywalled content](https://developers.google.com/search/docs/appearance/structured-data/paywalled-content?hl=en)
- [Google Search Central: locale-adaptive pages](https://developers.google.com/search/docs/specialty/international/locale-adaptive-pages?hl=en)
- [Google Search Central: verifying Googlebot](https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot?hl=en)
- [Next.js: userAgent](https://nextjs.org/docs/app/api-reference/functions/userAgent)

Next steps: [eliminate misleading content aimed at bots](https://checklist-seo-geo.com/en/practices-avoid/eliminate-misleading-content-aimed-at-bots) and [check manual actions](https://checklist-seo-geo.com/en/security-infrastructure/check-manual-actions).
