Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Cloaking: different content to bots and users, how to fix it

SEO-316High impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

Cloaking means a server returns one version of a page to search engine crawlers (such as Googlebot) and another to human visitors. The split is usually based on the visitor's user agent (the name a browser or bot sends to identify itself), their IP address, or the referrer (the page they came from).

Google's spam policies treat this as a violation when the goal is to manipulate rankings or mislead people. Common forms: keyword-stuffed text only bots can see, pharma or casino pages shown only to Google, and redirects that only fire for people arriving from search results.

Why it costs you leads or sales

Google can apply a manual action or demote the pages involved, so organic traffic drops sharply. AI assistants that rely on crawled content may also quote text your real visitors never see. If the cloaking comes from a hack, visitors may be sent to spam or scam pages, which destroys trust and conversions.

How cloaking breaks the path to a lead
  1. Search resultGoogle lists the page based on what Googlebot saw
  2. Server ruleServes different content by user agent or referrer
  3. Visitor landsSees spam, a redirect or unrelated content
  4. Lead or saleNever happens

The bot sees one page, the visitor lands on another, and the lead is lost.

Organic visits after a cloaking penaltyExample numbers
Organic visits after a cloaking penalty (example)Week 1: 2,000 visits per week; Week 2: 1,950 visits per week; Week 3 (action): 600 visits per week; Week 4: 550 visits per week; Week 6 (fixed): 900 visits per week; Week 8: 1,500 visits per week07671,5332,0001,9506005509001,500Week 1Week 2Week 3 (action)Week 4Week 6 (fixed)Week 8visits per week

Example: illustrative numbers showing traffic falling after a manual action and recovering after cleanup and review.

How to check if your site has it

Compare what bots and people see
  1. Check Search Console for warnings

    Open Google Search Console, then Security & Manual Actions, then Manual actions. Look for messages mentioning cloaking, sneaky redirects or hacked content.

  2. Run a live URL Inspection

    In Search Console, inspect the URL, click Test live URL, then View tested page. Compare the HTML and screenshot with the page in your browser.

  3. Fetch the page with a bot user agent

    Use curl with a Googlebot user agent and compare the output with a normal request (command below). Large differences in text, links or redirects are a red flag. Note that real Googlebot is verified by IP, so a spoofed test can miss IP-based cloaking.

  4. Test the referrer and device

    Open the page by clicking through from a Google search result, on a phone, in a private window. Cloaked redirects often fire only for search referrals.

  5. Search your own site on Google

    Search site:yourdomain.com and look for titles about pills, gambling, loans or other topics you do not publish.

Compare a browser request with a Googlebot user agentbash
curl -sL -A "Mozilla/5.0" https://example.com/page -o user.html
curl -sL -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" https://example.com/page -o bot.html
diff user.html bot.html | head -50

How to fix it

Cloaking is nearly always caused by something you did not intend: a compromised file, a plugin, or a rule written for a legitimate reason that went too far. Find the code that branches on user agent, IP or referrer and remove it.

Remove the cause
  1. Back up the site

    Take a full backup of files and database before changing anything, so you can investigate later.

  2. Search for user agent and referrer checks

    Look in theme files, .htaccess, nginx config, and plugins for HTTP_USER_AGENT, Googlebot, HTTP_REFERER and unfamiliar redirects.

  3. Remove unknown or injected code

    If you find obfuscated code (long base64 strings, eval calls) you did not add, treat the site as hacked: restore clean files, rotate all passwords and keys, and update everything.

  4. Serve the same main content to everyone

    If a rule is deliberate (for example language or device), make sure bots and users get the same core content and URLs.

  5. Request a review if flagged

    If Search Console shows a manual action, fix every affected page, then use Request review under Manual actions and explain what you removed.

Where to look by platform
  1. Scan and compare files

    Run a malware scanner plugin, then reinstall WordPress core, themes and plugins from clean copies. Check wp-content/uploads for PHP files and the theme's functions.php and header.php for injected code.

  2. Check .htaccess

    Open .htaccess in the site root and delete RewriteCond lines that test HTTP_USER_AGENT or HTTP_REFERER unless you added them.

  3. Review users and plugins

    Remove unknown admin users and any plugin you do not recognise or that is abandoned.

Before and after cleanup

Cloaked

  • Googlebot sees keyword text and links
  • Visitors from Google are redirected elsewhere
  • Search Console shows a manual action

Fixed

  • Bots and visitors get the same main content
  • No user agent or referrer based redirects
  • Review requested and manual action cleared

How to confirm it's fixed

Confirmation checks
  • The curl comparison shows no meaningful difference between the browser and bot user agent
  • URL Inspection live test matches what you see in a browser
  • Clicking through from a Google result on mobile lands on the right page
  • site: search shows no unexpected pages
  • The Manual actions report shows no issues, or your review was approved
  • All passwords, API keys and admin users were reviewed after any hack

How to prevent it happening again

Prevention
  • Keep CMS, themes and plugins updated and remove unused ones
  • Use strong unique passwords and two-factor authentication for hosting, CMS, CDN and tag manager
  • Limit admin and file-editing access
  • Keep files in version control and review unexpected changes
  • Review redirect and rewrite rules each quarter
  • Add your site to Search Console and turn on email alerts
  • Re-run the bot versus browser comparison on key pages after major changes

How FunnelGuard handles this

FunnelGuard does not check for cloaking today. Comparing what bots and users see is a possible future check, but it is not part of the product now.

What FunnelGuard does do is run your real customer journeys on a schedule, such as lead forms, checkouts and booking buttons, and check each step, the tracking hits sent to ad and analytics platforms, and whether test leads arrive. If a hack or bad rule breaks a form or sends visitors to the wrong page, a failed journey can show the effect, but it will not tell you that cloaking is the cause. Our robot uses its own marked user agent, so it is not a substitute for a bot comparison.

To watch for cloaking yourself, keep Search Console email alerts on, run the curl comparison above on your key pages monthly, and use a malware or file-integrity scanner on your hosting or CMS.

Questions people ask

What is cloaking in SEO?

Cloaking is showing search engine crawlers different content or URLs than real visitors see. It is against Google's spam policies because it is meant to manipulate rankings or mislead people. It can lead to demotion or a manual action.

Why does my site show different content to Googlebot?

Usually a hack, a malicious plugin or a server rule that branches on user agent, IP or referrer. Sometimes a legitimate setting such as a CDN rule or personalisation script goes too far. Compare a live URL Inspection with your browser to see the difference.

How do I check if my website is cloaking?

Use the URL Inspection live test in Google Search Console and compare it with what you see in a browser. Also run curl with a normal and a Googlebot user agent and diff the results. Then click through from a Google result on mobile to test referrer-based redirects.

Will Google penalise me for cloaking?

It can. Google may apply a manual action or lower rankings for pages that cloak. Check Security & Manual Actions in Search Console for any messages.

Is showing different content on mobile and desktop cloaking?

No, not if the main content and purpose are the same. Responsive layouts and device-specific design are fine. It becomes a problem when you show materially different content or redirect only one group to something unrelated.

How do I get a cloaking penalty removed?

Remove the cloaking on every affected page, clean up any hack, then go to Manual actions in Search Console and choose Request review. Describe what you found and fixed. Google then reviews the site, which can take days or weeks.

Can a hacked site cloak without me knowing?

Yes. Hackers often show spam only to search bots or to visitors from Google so you never see it when you visit directly. Check Search Console, site: searches and the bot versus browser comparison.

Does FunnelGuard detect cloaking?

No. FunnelGuard does not check for cloaking yet. It monitors your funnels, tracking and test leads, so a broken journey may hint that something is wrong, but it will not identify cloaking.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.