Redirected websites are often a sign of a hack. Learn how to spot malicious redirects, tell them from normal ones, and get your site clean again.
Redirected websites fall into two groups. In the first, you sent visitors somewhere on purpose, for example from the old domain to the new one. That's healthy. In the second, someone else is sending your visitors to a pharmacy spam page, a fake prize survey or a scam "browser update" without your say-so. If a customer has told you "your site took me somewhere weird," you are almost certainly in the second group. This guide shows how to tell the two apart, why the second kind is so hard to spot, and what a proper fix involves.
Good Redirects vs. Hacked Redirects
Redirects are a normal part of running a website. Google's own documentation describes permanent 301 redirects as the right way to point an old URL to a new one when you move a page or a domain. The usual legitimate cases are:
- HTTP to HTTPS, so every visitor lands on the secure version
- non-www to www (or the reverse), so you don't have two copies of the site
- an old page URL to its replacement after a redesign
- an old domain to a new one after a rebrand
A hacked redirect has a different goal. It exists to steal your traffic and your search reputation. Google's spam policies call this "sneaky redirects": sending users to different content than what they or the search engine expected. A site owner didn't choose that. An attacker installed it.
Why You Probably Haven't Seen It Yourself
The most common complaint we hear is "I checked and my site looks fine." That's by design. Malicious redirect code is usually written to hide from the people most likely to catch it. Typical tricks include:
- redirecting only visitors who arrive from a Google search, not people typing your address directly
- skipping anyone logged in to WordPress, so you never see it while you're working in the dashboard
- targeting mobile devices or specific countries only
- firing once per visitor, using a cookie, so a second visit looks normal
If the only person who can't see the problem is the site owner, that's not a coincidence. It's how the malware is built.
How to Check Whether Your Site Is Being Redirected
You can run a few quick tests without touching any code. None of them proves your site is clean, but a single hit is enough to act on.
- Open a private browser window on your phone, search for your business on Google and tap your own result. Don't type the address in directly.
- Try again on mobile data rather than your office Wi-Fi, and from a different browser.
- Search Google for site:yourdomain.com and scan the titles and descriptions for foreign-language or pharma terms you never wrote.
- Open Google Search Console and look at the Security Issues and Manual Actions reports.
- Ask a customer or staff member to send a screenshot and the address bar URL of wherever they landed.
Don't skip the Google search step. Many redirect infections only trigger on search referrals, and that is exactly the traffic you pay to earn. If you want the broader picture of recent campaigns, our monthly website hack recap covers what attackers are doing to WordPress sites right now.
Where the Redirect Code Hides
Attackers rarely put the redirect in one obvious place. On a WordPress site, the usual hiding spots are:
- the .htaccess file, with rewrite rules that bounce certain visitors elsewhere
- the siteurl and home values in the database, or injected JavaScript in post content and widgets
- theme files such as header.php and functions.php, often with obfuscated code
- fake or nulled plugins, and "must-use" plugins that don't appear in the normal plugin list
- extra admin accounts that let the attacker walk back in
This is why deleting the one suspicious line you found rarely works. If a backdoor file or a rogue admin user remains, the redirect returns within days, sometimes hours. The cleanup has to cover files, the database and user accounts together.
What a Proper Fix Looks Like
A real cleanup follows a sequence. Take a full backup first, even of the infected site, so nothing is lost. Then scan and manually review the files, replace WordPress core and plugins with clean copies, and remove injected code from the database. Delete unknown admin users and rotate every password: WordPress, hosting, FTP and database. Finally, find and patch the way in, usually an outdated plugin or a stolen password, or the reinfection will follow. Our website malware removal service is built around that sequence, and what a real malware cleanup involves explains each step in more detail.
One warning from experience: skip the one-click "redirect fixer" plugins. They treat the symptom, not the infection, and some are junk themselves. If you're unsure how deep the problem goes, it's better to have someone check the server than to keep guessing.
What Redirects Cost You in Search
Besides annoying visitors, hacked redirects can lead Google to flag your pages, show a warning in results, or demote you. Because Google treats sneaky redirects as a spam violation, an infected site can lose visibility even though you did nothing wrong. We explain why this undoes your earlier SEO work in why a hacked site undoes every ranking gain. Once the site is clean, request a review in Search Console if a warning or manual action was applied, and keep watching the Security Issues report for a few weeks.
The takeaway: legitimate redirects are quiet, planned and permanent, while hacked ones are conditional, hidden and unexplained. If visitors are landing somewhere you didn't choose, treat it as a security incident, not a settings issue. Confirm it with the tests above, then get the whole infection removed, not just the symptom.
References
- Google Search Central β Spam Policies for Google Web Search (sneaky redirects)
- Google Search Central β Redirects and Google Search
This article is general educational information, not professional, medical, or purchasing advice. External links are provided for reference; DS Web Solutions Inc. is not affiliated with and does not endorse any third-party brand or organization listed.



