A customer tells you something strange: they clicked your site on Google and landed on a casino, a pharmacy shop or a page announcing they have won a prize. You open your website, and everything looks perfectly normal.
That does not mean the customer was wrong. It usually means your site has been hacked — and that the hack was built so you would not notice.
Why You Often Cannot See It Yourself
Redirect malware rarely fires for everyone. Attackers deliberately hide it from the people most likely to remove it. Depending on the infection, the redirect may only trigger when a visitor:
- arrives from a search engine rather than typing your address directly,
- uses a phone rather than a desktop computer,
- is not logged in to WordPress — so administrators never see it,
- visits for the first time — after which a cookie stops it from firing again.
That is why these infections can run for weeks. Refreshing your homepage while logged in tells you almost nothing.
How the Redirect Gets There
In most cases the entry point is the same as with other WordPress hacks: an outdated plugin or theme with a known vulnerability, or a stolen or weak admin password. Once inside, attackers place their code where it survives the longest and is hardest to spot, for example in:
- the database, often in posts, widgets or site settings,
- theme files that load on every page,
- the server configuration file
.htaccess, - a fake plugin, or hidden scripts inside a real one,
- additional hidden admin accounts that let them return later.
What It Costs You While It Runs
- Lost customers: paid ads and search traffic get sent straight to someone else's scam.
- Trust: visitors who land on a shady page will connect that experience with your name.
- Search rankings: Google may show a warning next to your site or in the browser, and traffic can fall sharply until the issue is cleaned up and reviewed.
- Hosting: some hosts suspend infected accounts to protect their other customers.
- Data: a hacker with enough access to add a redirect may also be able to reach customer data. On a site that stores personal data, that can raise legal questions of its own.
What to Do First
- Confirm it from outside. Test on a phone using mobile data, in a private browser window, clicking through from a Google search.
- Check Google Search Console for security issue reports.
- Note what you know: when it was first reported, which pages and which devices were affected.
- Save a copy of the site as it is now before anything is deleted — it can show how the attacker got in.
- Change passwords for WordPress, hosting and the database once you are sure your own device is clean.
Why Deleting One File Rarely Fixes It
This is where most do-it-yourself clean-ups fail. Remove the visible redirect and it often comes back days later, because the redirect is only what the attacker left in plain view. The way in, and usually one or more backdoors, are still there.
Restoring a backup can have the same problem: if the backup was taken after the infection began, you restore the hack along with your site. A lasting clean-up means finding every piece of malicious code in the files and database, closing the original vulnerability, removing unknown admin accounts and, if Google has flagged the site, requesting a review.