BF50 Black Friday · 50% off all plans
from $5/mo · Auto-applied ---:--:-- Claim 50% off →
Skip to content

Search Seonio

Type a keyword, domain, or paste a URL

Start free with $1 to see full results. Powered by Seonio
SEO

Cloaking in SEO: What counts and what doesn't

Cloaking shows search engines one page and visitors another, and Google treats it as spam. Paywalls, dynamic rendering and A/B tests can be fine.

Monthly searches · cloaking
246.0k
Keyword research data
cloaking
Cloaking in SEO: What counts and what doesn't
Click the image to view it full size

With cloaking, a server first checks who is asking for a page, usually by the user agent (such as "Googlebot") or the IP address. Crawlers get a version built to rank; people get different content.

Google's spam policies name two typical cases: Google Search Central

  • showing search engines a page about travel destinations while showing visitors a page about discount drugs
  • adding text or keywords to a page only when a search engine requests it

Either way, the searcher clicks a result for one thing and lands on another. That's why Google treats cloaking as spam.

What happens if Google finds cloaking

Sites that break Google's spam policies may rank lower or disappear from results altogether. Google's automated systems catch some cases. Others lead to a manual action, which you'll see in Search Console's Manual Actions report as "Cloaking and/or sneaky redirects".

A sneaky redirect is cloaking's close relative: people are sent to a different URL than the one Google saw, for example only when they arrive from Google search.

What isn't cloaking

The test is whether a crawler and a person get essentially the same content. Plenty of setups vary what's sent and stay within the rules.

Paywalls and gated content

A paywall is not cloaking if Googlebot sees the full content that any subscriber would see, and the site follows Google's Flexible Sampling guidance. Mark the paywalled part with structured data (isAccessibleForFree set to false, and the paywalled section identified with hasPart and a cssSelector). That markup is how Google tells your paywall apart from cloaking. Google Search Central

Dynamic rendering for JavaScript sites

Some sites send crawlers a pre-rendered HTML version and send browsers the JavaScript app. Google doesn't treat this as cloaking as long as both versions hold similar content. A page about cats for people and a page about dogs for crawlers would be cloaking. Google also calls dynamic rendering a workaround, not a recommended solution; server-side rendering, static rendering or hydration serve everyone the same thing. See web rendering for the options.

Mobile layouts

Responsive design and dynamic serving change the layout and code for phones. That's fine as long as the main content is the same. With mobile-first indexing, Google indexes and ranks the mobile version, so content missing there is missing for Google too.

A/B tests

Testing page variants is fine. Don't show Googlebot one set of URLs and people another, including through user agent checks or robots.txt. Use rel="canonical" on the variant pages, use 302 (temporary) redirects if the test redirects people, and end the test as soon as you have your answer.

Localization by IP: allowed, but risky

Showing visitors from different countries different prices or content isn't cloaking if Googlebot gets what a visitor from its location gets. But Google advises against adapting content by IP. Most of Googlebot's crawling comes from the United States and it doesn't send an Accept-Language header, so it may never see your other versions. Give each version its own URL and connect them with hreflang instead.

Cloaking you didn't know about

Most site owners who find cloaking on their site didn't put it there.

  • Hacked sites. Attackers often inject spam pages or links and cloak them, so search engines see the spam but you see your normal site. Spammy titles for your pages in search results, or a manual action, are often how owners find out.
  • Plugins and conditional code. A CMS plugin, an .htaccess rule or a script may treat crawlers or visitors from Google differently, for example to redirect mobile visitors from search.
  • Bot protection. A firewall or CDN rule that shows Googlebot a challenge or error page isn't cloaking in the spam sense, but Google indexes what it receives, so the effect on your rankings can be just as bad.

How to check your site for cloaking

  1. Use URL Inspection in Google Search Console. Run a live test of the page and view the HTML and screenshot Google got.
  2. Compare it with what you see in a normal browser, logged out and in a private window. Look for extra text and links, different titles, or a different page entirely.
  3. Search Google with site:yourdomain.com. Titles and snippets in a language or on a topic you never published point to injected content.
  4. Check redirects from search. Click your own results on a phone and a computer, and make sure you land where the result promised.

How to fix it and recover

Find and remove the code that serves the different content, often in server-side code, .htaccess, JavaScript or a CMS plugin. If the site was hacked, clean it fully and close the hole the attackers used, or the spam comes back.

If you have a manual action, fix every affected page, make sure Google can crawl them, then choose Request Review in the Manual Actions report. Explain what was wrong and what you changed. Reviews can take days or weeks, and Google emails you when it's done.

SEO wiki

Related terms

More definitions from the same corner of SEO and digital marketing.

Seonio

Put it to work on your own site

Keyword research, traffic, backlinks and clustering in one place. Start with a free $1 to test, no card required.