Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Sneaky mobile redirects to ad networks: how to find and fix them

SEO-315High impactOther toolBy FunnelGuardPublished Updated
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.

Where a mobile visitor is lost
  1. Tap result or adVisitor on a phone clicks through
  2. Page starts loadingInjected script runs
  3. Redirect to ad networkVisitor ends up on a spam or scam page
  4. Form or checkoutNever reached

The visitor taps your result or ad, but injected code sends them away before the page is usable.

Mobile visitors who reach the contact formExample numbers
Mobile visitors who reach the contact form (example)Before the hack: 40 %; With the redirect: 8 %01531408Before the hackWith the redirect%

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.

Checks to run
  • 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

Remove the redirect
  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. Ask Google to review

    If Search Console shows a security issue or manual action, fix it first, then submit a review request.

Where to look on each platform
  1. 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.

  2. 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.

  3. Check redirects

    Open .htaccess and look for RewriteCond lines that test HTTP_USER_AGENT for Android or iPhone, or HTTP_REFERER for google.

Search a site's files for common redirect patternsbash
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

Confirmation checks
  • 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

Prevention
  • 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.

Phone visit before and after cleanup

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.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.