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.
- Search resultGoogle lists the page based on what Googlebot saw
- Server ruleServes different content by user agent or referrer
- Visitor landsSees spam, a redirect or unrelated content
- Lead or saleNever happens
The bot sees one page, the visitor lands on another, and the lead is lost.
Example: illustrative numbers showing traffic falling after a manual action and recovering after cleanup and review.
How to check if your site has it
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.
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.
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.
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.
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.
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 -50How 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.
Back up the site
Take a full backup of files and database before changing anything, so you can investigate later.
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.
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.
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.
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.
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.
Check .htaccess
Open .htaccess in the site root and delete RewriteCond lines that test HTTP_USER_AGENT or HTTP_REFERER unless you added them.
Review users and plugins
Remove unknown admin users and any plugin you do not recognise or that is abandoned.
Inspect theme code
Go to Online Store, Themes, Edit code. Search theme.liquid and other files for scripts that test the user agent or redirect by referrer.
Review apps and scripts
Under Apps, remove ones you do not use. Check Settings, Customer events and any Script Tag based apps for unknown scripts.
Check redirects
Under Online Store, Navigation, View URL redirects, delete redirects you did not create.
Audit Custom HTML tags
Open your container and review every Custom HTML tag and Custom JavaScript variable for user agent or referrer checks and unknown redirects.
Check versions and users
Under Admin, User Management, remove unknown users. Use Versions to see who published recent changes and roll back if needed.
Check custom code
In Site settings, Custom code, and each page's settings, look for scripts that redirect or hide content based on the user agent or referrer.
Review integrations and 301 redirects
Remove unknown integrations and check Hosting, 301 redirects for rules you did not add.
Search the codebase
Search for user agent, referrer and IP branching in server code, middleware, CDN edge workers and server config.
Check CDN and edge rules
Review rules in your CDN or edge functions that vary responses by user agent, country or referrer.
Compare with version control
Diff production files against your repository to spot files that were changed outside your deploy process.
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
- 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
- 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.
Related issues
- SEO-312Site hacked with spam pages or cloaked redirectsFix guide
- SEO-313Malware flagged by Google Safe BrowsingFix guide
- SEO-315Sneaky mobile redirects to ad networksFix guide
- SEO-317Compromised third-party script injecting linksFix guide
- SEO-314Deceptive site warning (phishing)Fix guide
- SEO-318Expired domain / domain about to lapseFix guide