Cloaking: Why Showing Google a Different Page Is Spam, and What Is Fine on a Trades Site
Cloaking means showing search engines one thing and visitors another. Google treats it as spam. Most trades sites never do it on purpose, but hacked sites and some plugins can. This guide explains the policy and how to check your own pages.
I am Robiul Alom Ronju, Founder of Nexranking. The policy points are from Google Search Central. My advice for trades is marked as mine.

What Google says cloaking is
- Presenting search engines with content that differs from what users see, to manipulate rankings or mislead people.
- Google’s example: a travel page for crawlers while users see a different, unrelated page.
- Adding keywords only when the request comes from a search engine, not for human visitors.
What is not cloaking
- JavaScript or image-based content is fine, as long as users and search engines can both reach it.
- Paywalled content is fine if Google can see the full gated content, as any subscriber could, and you follow Google’s guidance.
Hackers use cloaking
Google says hackers sometimes use cloaking to hide their changes from site owners. You open the site and see the normal pages, while Google sees injected spam.
How to check
This is my own advice. Use the URL inspection tool to see the page Google fetched and compare it with your browser. Search Google for your brand plus a spam word such as casino and see if your site appears. Ask your host to scan for malware. See how Google Search works.
Warning signs
- A search result title or description that you did not write.
- A sudden rise in impressions for words unrelated to your trade.
- Customers reporting a different page from the one you see.
- Your host sending a malware warning.
- New pages in the sitemap that you never created.
What to do first
This is my own advice. Take a backup before you change anything, scan the site, update everything, change passwords and then remove the injected files. Check the result with the URL inspection tool. If a manual action appears in Search Console, follow the steps in the manual actions guide.
A worked example
Illustrative example, not a client case. A plumber searches Google for his own business name and sees a result title about unrelated products. Opening the site shows his normal homepage. That mismatch suggests cloaking by a hacker. He uses the inspection tool, sees the injected page Google fetched, cleans the site, and then asks Google to review. The page does not say a recovery time.
Mistakes I see
- Assuming that a clean-looking homepage means a clean site.
- Ignoring odd titles in search results.
- Leaving old plugins and themes unpatched.
- Using a plugin that serves different content to bots.
- Never comparing the inspection tool’s view with the browser.
If you suspect a hack, ask for an audit and read the manual actions guide.
What is cloaking?
Showing search engines different content than users see, to manipulate rankings or mislead people.
Is JavaScript content cloaking?
No, if both users and search engines can access it.
Can hackers use cloaking?
Yes. Google says they sometimes use it to hide changes from owners.
How can I see what Google sees?
Use the URL inspection tool and compare with your browser view.
What is the penalty?
Google may rank the site lower or remove it, and manual actions can apply.
Related guides
- Keyword Stuffing on Trades Websites: Town Lists, Phone Number Blocks and What Google Says
- Link Spam and Buying Links: What Google Says Trades Businesses Should Avoid
- Scaled Content Abuse: Why 100 Town Pages Written by AI Can Hurt a Trades Website
Browse every guide in the local SEO guides for trades hub.
Sources
- Google Search Central, Spam policies for Google web search: https://developers.google.com/search/docs/essentials/spam-policies