On this page
What this issue is
Attackers break into a site through an outdated plugin, a weak password or a stolen login. They then add pages or code that serve their own purposes. Common forms are thousands of spam pages (often pharmacy, casino or foreign-language product pages), hidden links to other sites, and cloaked redirects. Cloaking means the site shows different things to different visitors. You, typing your address directly, see a normal page. A person arriving from a Google result, or Googlebot itself, gets the spam or a redirect.
Why it costs you leads or sales
Visitors from search land on scam or unrelated sites instead of your offer, so leads and orders stop while the site looks fine to you. Google may also label results with a hacked warning, or drop your pages. Spam pages dilute your real content, and browsers can show a red warning screen that stops people entering at all. Recovery takes time, so every day matters.
- Google resultPerson clicks your listing
- Injected codeChecks referrer or user agent
- Spam siteVisitor is sent away
- Lead formNever seen
The owner types the address and sees nothing wrong. Search visitors never reach the funnel.
Example: illustrative numbers showing leads falling once search visitors are redirected, and recovering after cleanup.
How to check if your site has it
Open Search Console Security issues
In Google Search Console, go to Security & Manual Actions, then Security issues. Google lists hacked content or malware it has found. Also check Manual actions.
Search Google for spam on your domain
Search site:yourdomain.com with words like viagra, casino, loan, replica, or foreign characters. Unknown pages in the results are a strong sign.
Test as a search visitor
Open a private window, search for your brand on Google and click your result. Do it on a phone too. Compare with typing the address directly.
Inspect the page as Googlebot sees it
In Search Console use URL Inspection, then View crawled page and Test live URL. Compare the HTML and screenshot with what you see.
Check the Pages report
Under Indexing, Pages, look for a sudden jump in indexed URLs or odd URLs you never published.
Look for unknown files and users
List admin users, recently changed files, and unfamiliar files in your web root. Check .htaccess and index.php for code you do not recognise.
# Files changed in the last 7 days
find . -type f -mtime -7 -name '*.php'
# Suspicious functions often used to hide malicious code
grep -rlE 'eval\(base64_decode|gzinflate\(base64_decode|str_rot13' .
# Check for rogue redirect rules
grep -n -i 'RewriteCond.*(google|bing|referer)' .htaccessHow to fix it
Take a full backup of the infected site
Keep a copy for investigation, then work on a clean restore. Tell your host; many offer malware scans or a restore.
Restore from a clean backup if you have one
Pick a backup from before the first sign of the hack. Then apply all updates before going live, or the same hole stays open.
Otherwise remove the malicious code
Replace core files, themes and plugins with fresh copies from official sources. Remove unknown files and plugins. Review .htaccess, wp-config.php and the uploads folder, where PHP files should not live.
Remove unknown users and rotate every secret
Delete rogue admin accounts. Change passwords for the CMS, hosting, FTP/SFTP, database and email. Replace API keys and the salts in wp-config.php. Turn on two-factor sign-in.
Update everything and remove unused software
Update the CMS, themes and plugins. Delete anything you do not use, and replace abandoned plugins.
Remove spam URLs from Google
Make the spam URLs return 404 or 410. Use the Removals tool in Search Console for urgent cases, and remove any spam sitemap you find.
Request a review
If Search Console shows a Security issue or manual action, fix it, then use Request review and describe what you cleaned and how.
Reinstall core and check users
In Dashboard, Updates, choose Re-install version. Check Users for unknown administrators and delete them.
Replace plugins and themes
Delete and reinstall each plugin and theme from the official source. Remove nulled (pirated) themes or plugins, a common entry point.
Scan and harden
Run a security plugin scan, check wp-content/uploads for .php files, disable file editing with define('DISALLOW_FILE_EDIT', true); in wp-config.php.
Review staff and apps
Under Settings, Users and permissions, remove unknown staff. Remove apps you do not recognise and review their access.
Check theme code
In Online Store, Themes, Edit code, search theme.liquid for unfamiliar script tags or redirects. Publish a clean theme version if needed.
Reset credentials
Change the owner password, enable two-step authentication and contact Shopify Support if you suspect account compromise.
Audit tags and users
Open each container and review Custom HTML tags and Custom JavaScript variables for code you did not add. Check Admin, User management.
Use version history
Compare versions and publish a clean earlier version if a malicious tag appeared. Remove unknown users.
Check custom code
In Site settings, Custom code, and each page's settings, look for scripts you did not add. Check connected integrations.
Secure access
Remove unknown workspace members, change your password and enable two-factor authentication.
Review custom code and users
Check funnel and website settings for custom header or footer code and tracking code you did not add. Remove unknown team users.
Rotate access
Change passwords and API keys, and contact support if you see changes you cannot explain.
Check code and contributors
Review Custom Code under Settings and any Velo code. Remove unknown contributors under Roles and Permissions.
Secure the account
Change your password and turn on 2-step verification.
Check code injection
In Settings, Developer Tools, Code Injection, look for scripts you did not add. Review contributors under Permissions.
Secure the account
Change your password and enable two-factor authentication.
Rebuild from version control
Redeploy from a known-good commit, then diff the server against the repository to find altered files.
Fix the entry point
Review server logs for the first suspicious request. Patch the vulnerable library or form handler, and rotate SSH keys, database and API credentials.
How to confirm it's fixed
- Search Console shows no Security issues and no Manual actions
- site: searches no longer show spam pages (allow time for Google to recrawl)
- Clicking your result from Google on desktop and mobile lands on your real page
- URL Inspection live test shows the same HTML as a normal visit
- No unknown admin users, plugins or recently changed files
- All passwords and keys changed, two-factor sign-in on
- Your lead form and checkout still work end to end
How to prevent it happening again
- Turn on automatic updates for core, themes and plugins where safe
- Delete unused plugins, themes and old staging copies
- Never use nulled or pirated themes and plugins
- Use unique strong passwords and two-factor sign-in for every admin
- Give each person the lowest access role they need
- Keep off-site backups and test a restore
- Add Search Console email alerts to a shared inbox, not one person
- Review admin users and Custom HTML tags every quarter
Hacked
- Unknown pages indexed in Google
- Search visitors redirected
- Owner sees nothing wrong
- Unknown admin user exists
Clean
- Only your pages appear in site: searches
- Search visitors reach your funnel
- Search Console shows no security issues
- Access limited and protected by two-factor sign-in
How FunnelGuard handles this
FunnelGuard does not check for hacked content, spam pages or cloaked redirects today. It is a possible future check. Do not rely on it for this problem.
What it does cover nearby: a robot visitor runs your real journeys, such as lead forms, checkouts and booking buttons, on a schedule. If a hack breaks a form or a step, the failure is re-checked from a second region and you get one alert with a screenshot and a likely cause. It also checks tracking hits and whether test leads reach your inbox and CRM. That can reveal damage, but it will not tell you that a hack is the reason.
Questions people ask
How do I know if my website has been hacked with spam pages?
Check Google Search Console under Security & Manual Actions, then search site:yourdomain.com for words like casino, pharmacy or foreign characters. Unknown pages in results, a sudden rise in indexed URLs or odd admin users all point to a hack.
Why does my site redirect only when I come from Google?
Injected code is probably checking the referrer or user agent and redirecting search visitors while showing you the normal page. Test in a private window by clicking your Google result, and inspect .htaccess, theme files and plugins for redirect code.
Can I fix a hacked site by deleting the spam pages?
Not on its own. The attacker's backdoor, weak password or outdated plugin remains, so the pages come back. Remove the malicious code and unknown users, update all software and change every password too.
How do I get Google to remove the hacked warning?
Clean the site and close the hole, then open Security issues in Search Console and choose Request review, explaining what you fixed. Google rechecks and, if clean, removes the label. It can take days.
What is the Japanese keyword hack?
It is a hack that creates many pages with Japanese text, often selling counterfeit goods, which then get indexed under your domain. It is cleaned the same way as other spam hacks: remove the injected files, fix the entry point, and ask Google to reindex.
How did my site get hacked in the first place?
Common causes are outdated plugins or themes, pirated (nulled) add-ons, reused or weak passwords, and stolen logins. Server logs and file change dates can show the first suspicious request.
Does FunnelGuard detect hacked sites?
No. FunnelGuard does not check for hacked content or cloaked redirects yet. It monitors your funnels, tracking and lead delivery, which can show symptoms, so pair it with Search Console and a malware scanner.
Related issues
- SEO-313Malware flagged by Google Safe BrowsingFix guide
- SEO-316Cloaking: different content to bots and usersFix 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-319Spam outbound links from comments or widgetsFix guide