Cloaking is showing search engines different content from what people see, with the intent to manipulate rankings and mislead users. Google's own example is a page that shows search engines content about travel destinations while showing visitors a page about discount drugs. A subtler version adds keyword-rich text only when the visitor is a search engine crawler.
For a business, cloaking is one of the clearest violations of Google's spam policies, and it can cost a site its rankings. It's also a common sign of a hacked website. Even if you'd never cloak on purpose, it's worth knowing how it works so you can spot it on your own site.
What is cloaking?
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. The key ideas are "different content" and "intent." Search engines are meant to see what your visitors see, so they can judge whether a page is a good result.
Google lists examples such as:
- Showing a page about travel destinations to search engines while showing a page about discount drugs to users
- Inserting text or keywords into a page only when the user agent requesting the page is a search engine, not a human visitor
Cloaking usually works by checking who's asking for the page. A server can look at the user agent, the label a browser or crawler sends with each request, or at the IP address. When it detects a crawler like Googlebot, it serves one version. Everyone else gets another.
Why cloaking matters
It can remove you from search. Google says it detects spam through automated systems and, as needed, human review that can result in a manual action. Sites that violate its policies may rank lower or not appear in results at all.
It's a warning sign of a hack. Google notes that when a site is hacked, it's not uncommon for the hacker to use cloaking to make the hack harder for the site owner to detect. You might see your normal site in a browser while Google sees spam pages, pharmaceutical links or foreign-language content.
It now targets AI tools too. In October 2025, security firm SPLX published research on what it called AI-targeted cloaking. In its tests, a server detected AI agents by their user agent and served them altered content, while human visitors saw the normal page. The AI tools tested repeated the altered version without flagging it. The research shows that the same trick used on search crawlers can shape what AI assistants say about a person or business.
It erodes trust. Visitors who click a result and land on something different from what they expected leave and may not come back.
How cloaking works
User agent and IP detection
The most common method checks the user agent string or IP address of each request. If it matches a known search engine or AI crawler, the server returns a special version of the page. Because crawlers announce themselves, this is technically simple, which is why it's tempting for spammers and attackers.
Cloaking through hacks
Attackers who gain access to a site often add hidden pages or injected content and then cloak it, so the owner sees nothing unusual. Google's spam policies treat hacked content as a separate violation and recommend fixing hacked sites promptly.
Related tactics
Google lists sneaky redirects as a related violation: sending search engines one type of content while redirecting users to something significantly different, or redirecting only mobile visitors to a spam domain. Hidden text, such as white text on a white background, is another way of showing search engines content people don't see.
What isn't cloaking
Google says a paywall or content gate isn't cloaking if Google can see the full content behind it just like anyone with access, and the site follows Google's Flexible Sampling guidance. For content that search engines have trouble accessing, such as content that depends on JavaScript or images, Google recommends making it accessible to both search engines and users without cloaking. Approaches like server-side rendering serve the same content to everyone.
How to prevent and detect cloaking
- Serve the same core content to everyone. Don't build logic that changes a page's main content based on whether the visitor is a crawler.
- Check what Google sees. Use the URL Inspection tool in Google Search Console to view the crawled and rendered version of key pages and compare it with what you see in a browser.
- Watch for warning signs. Unexpected keywords in Search Console's query data, strange page titles in search results, or security alerts can all point to cloaked hacked content.
- Keep your site secure. Update your CMS, plugins and themes, remove unused ones and use strong, unique passwords with multi-factor login.
- Review third-party scripts and server rules. Check redirect rules, .htaccess files and plugins for code that treats crawlers differently.
- Fix and request review. If you find cloaking or a hack, clean it up. If you received a manual action, submit a reconsideration request in Search Console once it's fixed.
Common mistakes and misconceptions
- "It's only cloaking if the content is totally different." Adding keywords or text only for crawlers also counts, according to Google's examples.
- "Paywalls are always cloaking." Not if Google can see the full gated content like a subscriber would and the site follows Flexible Sampling guidance.
- "My site looks fine, so I'm not affected." Hacked sites are often cloaked precisely so the owner sees nothing wrong. Check what Google sees, not just what your browser shows.
- "Cloaking for AI crawlers is a safe way to shape AI answers." It's the same deceptive pattern, and research has shown it can spread false information. It's not a legitimate GEO strategy.
Cloaking vs. sneaky redirects
Both are Google spam policy violations, and both give search engines and people different experiences. Cloaking serves different content at the same URL depending on who's asking. Sneaky redirects send visitors to a different URL than the one search engines evaluated, such as redirecting mobile users to a spam domain. Google notes that many redirects are legitimate, like moving a site or consolidating pages. The question is whether a redirect, or a cloaked page, is intended to deceive users or search engines.
How Butter approaches cloaking
At Butter, we follow the principle that search engines and AI tools should see the same content your customers see. When we review a site, we compare what crawlers fetch with what visitors see on key pages, and we flag anything that looks like cloaked or injected content.
If something looks wrong, we help the client and their developer or host trace the cause, which is often an outdated plugin or a past hack. Our indexing and GEO work then focuses on making the real content easy for search engines and AI crawlers to access.
Frequently asked questions
Is cloaking illegal?
Cloaking is a violation of Google's spam policies, not a legal category in itself. The main risk for a site is lower rankings, removal from results or a manual action.
How do I know if my site is cloaking?
Compare what you see in a browser with what Google's URL Inspection tool shows for the same page. Unexpected spam keywords in Search Console or strange titles in search results are also common signs of cloaked hacked content.
Is showing different content by location or device cloaking?
Cloaking is about showing search engines different content from users to manipulate rankings. Google's examples focus on deceiving search engines or users, so keep the core content consistent and don't single out crawlers for special versions.
Can cloaking affect AI search?
Yes. SPLX research published in October 2025 showed that sites could serve altered content to AI agents based on their user agent, and the AI tools repeated it. It's the same deceptive pattern applied to AI crawlers.