On this page
What this issue is
Cloaking means a page returns one version of its HTML to search engine crawlers and another to normal visitors. In a hack, the attacker injects code that checks the visitor's user agent (for example Googlebot) or IP address. If it matches, the code swaps in spam: a casino, pharma or counterfeit-goods title, a changed meta description, or hidden links.
Because you and your customers get the clean version, nothing looks wrong when you open the page. The damage only shows up in Google results, which is why it often goes unnoticed for weeks.
- Request arrivesBrowser or Googlebot asks for the page
- Injected checkCode tests the user agent or IP
- Googlebot gets spamSpam title and meta are returned
- Google indexSpam snippet appears in search results
The injected code decides what to send based on who is asking.
Why it costs you leads or sales
People who search for your brand or service see a spammy or off-topic snippet and do not click. Your real title and description, which you wrote to win the click, are replaced. Google may also add a warning, drop pages from results or apply a manual action for spam, which cuts organic traffic to your landing pages and funnels.
Example: illustrative numbers showing clicks falling once spam snippets replace the real title.
How to check if your site has it
Search your own site
In Google, search
site:yourdomain.comand thensite:yourdomain.com casino OR pharma OR viagra OR replica. Look for titles or descriptions you did not write.Run a live URL Inspection
In Google Search Console, paste the affected URL into the top bar, click Test Live URL, then View Tested Page and open the HTML tab. Search it for the spam title or words.
Fetch the page as Googlebot
Use curl with a Googlebot user agent and compare it with a normal request. Spoofing the user agent only shows user-agent-based cloaking, not IP-based cloaking, so Search Console is more reliable.
Check Search Console reports
Open Security & Manual Actions and look for hacked content or spam warnings. Also check Performance for unfamiliar queries bringing impressions.
curl -s https://example.com/ | grep -i '<title'
curl -s -A 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' https://example.com/ | grep -i '<title'How to fix it
Back up the site first
Take a full copy of files and database so you can investigate and roll back if needed.
Find the injected code
Search files for suspicious patterns such as
Googlebot,base64_decode,eval(andgzinflatein theme files,functions.php,index.php,.htaccessand thewp-content/uploadsfolder. Also check database tables for changed titles, options and widgets.Remove it and restore clean files
Replace core files, themes and plugins with fresh copies from trusted sources. Delete unknown files, plugins and admin users.
Close the entry point
Update everything, remove abandoned plugins, change all passwords (hosting, FTP/SFTP, database, CMS admins) and rotate API keys.
Request re-indexing
In Search Console, run URL Inspection on key pages and click Request Indexing. If a manual action exists, fix the cause and submit a reconsideration request.
Check SEO plugin and theme
Review Yoast, Rank Math or similar settings for changed titles. Reinstall WordPress from Dashboard > Updates > Re-install now, and re-upload the theme and plugins from clean copies.
Audit users and plugins
Under Users, remove unknown administrators. Under Plugins, delete anything you do not recognise or no longer use. Check
wp-config.phpand.htaccessfor added code.
Inspect theme code
Open Online Store > Themes > Edit code and search theme.liquid and snippets for unfamiliar scripts or user-agent checks.
Review apps and staff
Remove unused apps and check Settings > Users and permissions for unknown staff accounts. Reset staff passwords.
Check for rogue tags
Look for Custom HTML tags you did not create that change document.title or meta tags. Review Admin > User Management for unknown users and check version history.
Check custom code and SEO settings
Review Site settings > Custom code and each page's SEO settings, plus any third-party scripts. Check Workspace members for unknown people.
Diff against version control
Compare the server files with your last known good commit. Any file that differs and is not in git is suspect. Redeploy from a clean build and rebuild the server if you cannot trust it.
How to confirm it's fixed
- URL Inspection live test shows your real title and description in the rendered HTML
- Search for unfamiliar spam words in the tested HTML returns nothing
- The
site:search shows correct snippets after recrawling (this can take days) - Search Console shows no security issue or manual action
- No unknown admin users, plugins or files remain
How to prevent it happening again
- Keep CMS, themes and plugins updated and delete unused ones
- Use unique strong passwords and two-factor authentication for admins and hosting
- Limit admin accounts and remove old staff or agency users
- Keep off-site backups so you can restore a clean version
- Add Search Console users only you trust and enable email alerts
- Check the Googlebot view of key pages after every major update
How FunnelGuard handles this
FunnelGuard does not check for this yet. Comparing what Googlebot receives with what visitors receive is a possible future check. Today FunnelGuard's robot runs your real customer journeys, such as forms and checkouts, and checks each step and tracking hit, so it only sees what a normal visitor sees. It would not reveal a cloaked title that only Google gets.
To watch for it yourself, check Search Console's Security & Manual Actions report, run a live URL Inspection on your top landing pages after changes, and run a regular site: search for spam words. FunnelGuard can still help nearby: if a hack breaks a form, a tracking tag or a redirect in a funnel, the scheduled journey check will report that failure. You can start with the Free plan (1 site, 2 journeys, daily checks, no card).
Questions people ask
Why does Google show a spam title for my site when my site looks normal?
Your site is probably hacked with cloaking code that sends spam HTML only to Googlebot. Visitors, including you, get the clean page. Use the live test in Search Console's URL Inspection to see the HTML Google receives.
What is cloaking in a website hack?
Cloaking is when a page returns different content to search engine crawlers than to people. Attackers use it to inject spam titles, descriptions and links for Google while hiding them from the site owner.
How do I see my website as Googlebot sees it?
Open Google Search Console, inspect the URL, click Test Live URL and then View Tested Page to see the rendered HTML and screenshot. Curl with a Googlebot user agent can help, but it misses cloaking based on IP address.
How do I remove spam meta descriptions from Google search results?
Remove the injected code and close the entry point, then request indexing for affected URLs in Search Console. Google updates snippets after it recrawls the pages, which can take days or weeks.
Can a plugin or theme cause cloaked SEO spam?
Yes. Outdated, nulled or abandoned plugins and themes are common entry points. Replace them with clean copies from official sources and delete anything you do not use.
Does FunnelGuard detect cloaked SEO spam?
No. FunnelGuard does not check for this yet; it could be a future check. It tests your real funnel steps as a normal visitor, so use Search Console and site: searches to watch for cloaking.
Will a manual action be applied if my site is cloaking spam?
It can be. Google may apply a manual action for hacked or spammy content, shown in Search Console under Security & Manual Actions. After cleaning the site you can submit a reconsideration request.
Related issues
- OPS-142Japanese keyword / pharma / casino spam pages injectedFix guide
- OPS-141Conditional redirect hack only for search/ad referrersFix guide
- OPS-150Search Console security issues / manual actionsFix guide
- OPS-143Hidden spam links in footerFix guide
- OPS-148Rogue admin user createdFix guide
- OPS-149Backdoor files (web shells) on serverFix guide