WordPress Security ServicesMalware Removal
Redirect Malware Removal

WordPress Redirect Malware Removal: Stop the Redirects for Good

Your visitors land on a scam, gambling, or fake-prize page instead of your site, but when you check, everything looks fine? That's how redirect malware is built to behave. I track down every place the redirect is triggered from, remove it, and close the hole it came through.

$95 for one infected WordPress site

Includes a 1-month hassle-free guarantee. Multiple infected sites are priced separately. Guarantee terms

Sergey, WordPress security specialist
Top Rated 100% Job Success 10 years · 200+ sites cleaned
Signs of redirect malwareSYMPTOMS
  • Visitors complain, but you can't reproduce it
    The redirect skips logged-in admins and people who have visited before.
  • Only on mobile, or only from Google
    Desktop and direct visits look normal; phones and search clicks don't.
  • Browser or Google warnings
    "Deceptive site ahead" or a drop in traffic from Search Console.
  • It comes back after cleanup
    A backdoor or cron job is reinstalling the redirect.

What WordPress redirect malware is

Redirect malware, often called the “WordPress redirect virus”, is code an attacker adds to your site to send your visitors somewhere else: scam pages, fake prize pages, gambling sites, adult sites, or pages that push malicious browser notifications. The attacker gets paid for every visitor delivered. Your site is just the traffic source.

It’s one of the most common infections I clean, and one of the most frustrating for owners, because it’s designed so that you don’t see it.

Why the redirect only happens sometimes

A redirect that hit every visitor would be reported and removed within hours. So most redirect malware is conditional. Before redirecting, it checks things like:

  • Are you logged in? Admins are skipped, so the owner never notices.
  • Have you been here before? It sets a cookie on the first visit and leaves you alone afterwards.
  • What device are you on? Many redirects only target phones.
  • Where did you come from? Visitors arriving from Google, Bing, or Facebook are redirected; direct visits are not.
  • What time is it, or which country are you in? Some only fire at certain hours or for certain regions.

That’s why “I checked and it’s fine” means very little with this kind of infection.

Some versions also hijack the admin area: wp-login.php or wp-admin suddenly redirects to another domain, so you can’t even log in to fix it. That’s still the same infection, and still fixable without the dashboard.

How to check for a redirect yourself

  1. Use a phone on mobile data (not your Wi-Fi), in a private or incognito tab.
  2. Search Google for your site’s name and click your own result.
  3. Try a couple of inner pages, not just the homepage.

If you have a terminal, you can also see exactly what different visitors receive:

# Arriving from Google on a phone
curl -sIL -A "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 Mobile/15E148" \
     -e "https://www.google.com/" https://example.com/ | grep -i "^location"

# Google's crawler
curl -sIL -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" https://example.com/ | grep -i "^location"

Any Location: pointing to a domain that isn’t yours is a server-side redirect. Note that JavaScript redirects won’t show up here: they happen in the browser after the page loads, so the phone test is still important.

Where redirect malware hides in WordPress

Redirects can be triggered from many places, and an infected site often has two or three of them at once. Removing one and missing the others is the most common reason “the redirect came back”.

Location What it usually looks like
.htaccess files RewriteCond rules checking HTTP_REFERER or HTTP_USER_AGENT, followed by a RewriteRule to another domain
Theme files A few lines added to functions.php, header.php or footer.php that print a script for logged-out visitors
Plugins Injected code in a real plugin, or a fake plugin with a believable name
The database A <script> tag added to posts, widgets, or theme settings, or a changed siteurl / home value in wp_options
JavaScript files Obfuscated code appended to the end of a legitimate .js file in your theme or a plugin
Server settings An auto_prepend_file line in .user.ini or php.ini that runs a malicious file before every page

How I remove redirect malware

  1. Reproduce the redirect using the same conditions your visitors have (device, referrer, first visit), so I know exactly what to look for and can confirm it’s gone later.
  2. Trace it to the source. I follow the redirect back from the browser to the code that produced it: a script tag, a PHP function, an .htaccess rule, or a database value.
  3. Check every other hiding place in the table above, because there’s usually more than one.
  4. Find the backdoor and the entry point. The redirect is the payload. The backdoor is what lets the attacker put it back. I remove both and fix the vulnerable plugin, theme, or password that let them in.
  5. Verify with the same mobile, search-referrer, and crawler tests, then help you request a Google review if the site was flagged.

A typical case: a store owner hears from customers that the site “goes to a lottery page” on their phones. The owner can’t reproduce it, and two scanners report the site as clean. The cause turns out to be a short script stored in the database, inside a theme option, that only loads for mobile visitors arriving from search engines. A second copy sits in a fake plugin called something like “wp-cache-helper”, which re-adds the script whenever it’s removed. Cleaning the database alone wouldn’t have lasted a day. Removing both, then updating the outdated page builder plugin that let the attacker in, fixed it for good.

After the redirect is gone

  • If Google flagged the site, request a review in Search Console under Security issues. Malware reviews usually finish within a few days.
  • Reset passwords and security keys so any stolen sessions stop working.
  • Keep an eye on it for a few weeks. If the same redirect returns within a month, my guarantee covers it.

Redirects are just one kind of infection. If your site shows other symptoms too, see my full WordPress malware removal service or what to do when your WordPress site is hacked.

Common Questions

Redirect Malware FAQ

Why does my WordPress site redirect only on mobile?

Because the malware checks the visitor's device before doing anything. Mobile visitors are less likely to notice a strange domain and more likely to tap through scam pages, so many redirect scripts target phones only. It's a sign of a deliberate infection, not a glitch.

Why can't I see the redirect when I visit my own site?

Most redirect malware skips logged-in WordPress users and visitors who already have a cookie it set earlier. Some also skip direct visits and only redirect people coming from Google. Test from a phone on mobile data, in a private window, by clicking your site in Google search results.

Will reinstalling WordPress remove the redirect?

Rarely on its own. Reinstalling core replaces wp-admin and wp-includes, but redirects usually live in the theme, plugins, the database, or .htaccess, none of which a core reinstall touches. And if the backdoor stays, the redirect comes back.

Can a security plugin remove redirect malware?

Sometimes, if the redirect uses known code in a file. Plugins are much less reliable when the redirect is stored in the database, hidden in .htaccess, or loaded from another domain only for certain visitors. If you've run a plugin cleanup and the redirect continues, it needs a manual investigation.

Is the redirect dangerous for my visitors?

It can be. Redirect chains often end on phishing pages, fake virus warnings, malicious browser notifications, or downloads. That's why Google may flag the site and browsers may show a red warning screen. The sooner it's removed, the less damage to your visitors and your search rankings.

Stop the redirects

Send me your URL and where the redirect goes

Tell me which device or situation triggers it and where visitors end up. I'll trace it to the source and remove it, usually within a day.

$95 per infected site · 1-month guarantee · direct contact with the specialist

Request Malware Removal →