On this page
What this issue is
A sneaky redirect sends visitors somewhere they did not expect. Google's spam policies name it directly: it is a redirect that shows search engines one page and sends users to another. The mobile version is common because attackers want the owner, who usually checks on a desktop, to stay unaware.
The redirect is often conditional. It may fire only on phones, only on the first visit, only when the visitor came from Google, or only outside your own country. That is why you can load your site ten times and see nothing wrong.
Why it costs you leads or sales
Mobile visitors never reach your form, product page or checkout. Paid clicks are wasted, because the ad click is paid for but the visitor lands on someone else's page. Google may also flag the site, add a warning in search results or drop pages from the index, and trust is hard to win back.
- Tap result or adVisitor on a phone clicks through
- Page starts loadingInjected script runs
- Redirect to ad networkVisitor ends up on a spam or scam page
- Form or checkoutNever reached
The visitor taps your result or ad, but injected code sends them away before the page is usable.
Example: illustrative numbers only. A redirect that fires on most phone visits cuts the share who reach the form.
How to check if your site has it
Test the way a victim would. Attackers often hide the redirect from logged-in admins and from repeat visits, so a normal check can miss it.
- Open your site on a real phone using mobile data, not your office Wi-Fi.
- Open it in a private tab, after clicking through from a Google search result for your own brand.
- Try a second phone and a different network or country if you can.
- In Google Search Console, open Security & Manual Actions and read both reports.
- Use Search Console URL Inspection, then View tested page, and compare the rendered page with what you see.
- In Chrome DevTools, turn on device mode, open the Network tab, tick Preserve log and reload to see which request triggers the jump.
- View page source and search for window.location, location.replace, meta refresh and unfamiliar script domains.
- Check your ad landing pages and any redirect rules in your host or CDN.
How to fix it
Take a backup
Save a copy of the files and database so you can inspect the infection later. Then put the site in maintenance mode if you can.
Find the injected code
Search for the redirect domain you noted, and for patterns such as eval(base64_decode, window.location, document.referrer and navigator.userAgent. Check .htaccess, index.php, theme header and footer files, and the database options and posts tables.
Check scripts loaded from other sites
List every external script on the page. Remove any you do not recognise, including tags in your tag manager and header or footer code fields.
Replace core files with clean copies
Reinstall the CMS core, plugins and themes from official sources. Delete plugins and themes you do not use, and any nulled (pirated) ones.
Close the way in
Change all passwords (admin, hosting, FTP, database, tag manager), remove unknown admin users, and update everything. Turn on two-step login.
Ask Google to review
If Search Console shows a security issue or manual action, fix it first, then submit a review request.
Scan and reinstall
Run a malware scan with a security plugin you trust, then reinstall core from Dashboard > Updates > Re-install version. Check wp-content/uploads for .php files, which should not be there.
Check header and footer injections
Review header.php and footer.php, functions.php, the wp_options table (siteurl, home, widget text) and any plugin that inserts header scripts. Look for unknown admin users under Users.
Check redirects
Open .htaccess and look for RewriteCond lines that test HTTP_USER_AGENT for Android or iPhone, or HTTP_REFERER for google.
Check theme code
In Online Store > Themes > Edit code, search theme.liquid for unfamiliar script tags. Compare with a fresh copy of your theme.
Review apps and staff
Remove apps you do not use, since leftover app code can stay in the theme. Check Settings > Users and permissions for unknown staff.
Check Customer events
Under Settings > Customer events, remove custom pixels you do not recognise.
Audit tags
Open the container and review every Custom HTML tag and Custom Template. Look for scripts that set window.location or load unknown domains.
Check access
Under Admin > User Management, remove users you do not know. Use Version history to see when the tag was added and by whom.
Check custom code
Review Site settings > Custom code (head and footer) and each page's custom code for unknown scripts or embeds.
Check team and integrations
Remove unknown collaborators and review connected apps.
Review added code
Open Settings > Custom code and remove unknown snippets. Review installed apps and remove ones you do not use.
Secure the account
Change your password, turn on 2-step verification and check Roles & Permissions.
Check code injection
Open Settings > Developer Tools > Code Injection and review the header, footer and any page-level injection. Remove unknown code.
Check contributors
Review Settings > Permissions and remove unknown users. Change your password.
Search the code base
Use grep for the redirect domain and the patterns listed above. Compare files with your version control or a known clean deploy.
Check server config
Review web server rules, cron jobs and any included files that handle user agent checks. Redeploy from a clean source.
grep -rIl --include=*.php --include=*.js --include=*.html --include=.htaccess -E "eval\(base64_decode|window\.location|location\.replace|HTTP_USER_AGENT" .How to confirm it's fixed
- Load the site several times on a real phone over mobile data, including after a Google search click.
- Reload with DevTools device mode and confirm no request goes to the old redirect domain.
- Run URL Inspection in Search Console and check the rendered page.
- Confirm the Security issues report is clear, or the review request was approved.
- Check again after 24 hours, since reinfection often shows up quickly.
How to prevent it happening again
- Keep the CMS, themes and plugins updated, and remove ones you do not use.
- Use strong unique passwords and two-step login for hosting, CMS and tag manager.
- Limit admin users and review them every few months.
- Avoid nulled themes and plugins.
- Keep a short list of approved third-party scripts and review it.
- Keep regular backups stored away from the web server.
- Add Search Console email alerts for the whole team.
How FunnelGuard handles this
FunnelGuard does not check for sneaky mobile redirects today. It is a possible future check. FunnelGuard runs your real customer journeys, such as lead forms and checkouts, on a schedule, so a redirect that stops a robot visitor from completing a journey can show up as a failed step. That is a side effect, not a redirect check, and a redirect that only fires on certain devices or referrers may be missed.
To watch for this yourself, use Google Search Console security alerts, check your site monthly on a real phone over mobile data, and consider a file integrity or malware scanner from your host or CMS. You can start with the free FunnelGuard plan (1 site, 2 journeys, daily checks, no card) to cover your core journeys.
Infected
- Desktop looks normal
- Phone visitors jump to an ad network
- Search Console may show a security issue
Cleaned
- Same page on phone and desktop
- No requests to unknown domains
- Passwords changed and software updated
Questions people ask
Why does my website redirect to ads only on my phone?
Injected code usually checks the visitor's device or referrer and only redirects phones or visitors from Google. This hides it from the owner on desktop. Look for scripts or server rules that test the user agent.
How do I find a hidden redirect on my website?
Test on a real phone over mobile data, then use Chrome DevTools device mode with the Network tab and Preserve log on. The first request to an unknown domain points to the source. Search your files, database and tag manager for that domain.
Can sneaky redirects hurt my Google rankings?
Yes. Google's spam policies treat sneaky redirects as a violation, and a hacked site can get a security warning or lose pages from search. Clean the site and request a review in Search Console.
Is a mobile redirect always a hack?
No. It can come from a compromised or bad third-party script, a tag manager tag, an ad or a rogue plugin. Either way, remove it, because visitors are being sent away without your intent.
Why can't I see the redirect when I'm logged in as admin?
Many redirects skip logged-in users and repeat visits to avoid detection. Test in a private tab on a phone, logged out, and arrive from a Google search result.
How do I stop my site being redirected again?
Update software, remove unused plugins, change all passwords, turn on two-step login and review admin users. Reinfection usually means the original entry point is still open.
Does FunnelGuard detect mobile redirects?
No, not yet. It is a possible future check. FunnelGuard does run your key journeys on a schedule, but it does not check specifically for sneaky mobile redirects.
Related issues
- SEO-312Site hacked with spam pages or cloaked redirectsFix guide
- SEO-313Malware flagged by Google Safe BrowsingFix guide
- SEO-314Deceptive site warning (phishing)Fix guide
- SEO-316Cloaking: different content to bots and usersFix guide
- SEO-317Compromised third-party script injecting linksFix guide
- SEO-318Expired domain / domain about to lapseFix guide