Hacked website redirecting to spam: your visitors land on a site that is not yours
Last reviewed
Your address is sending customers to a stranger's spam site.
A hacked website that redirects to spam sends some or all of its visitors to another site, usually gambling, pharmacy, fake shopping or adult pages, instead of showing your page. The attacker has added code to your site, its settings or its server so that loading your address forwards the browser elsewhere. It often only happens to visitors arriving from a search result or on a phone, which is why owners can miss it for weeks.
Why a hacked site that redirects to spam costs you customers
Every customer who reaches a spam site under your name assumes your business is careless or gone. Search engines treat the redirect as hacked content: they may show a "this site may be hacked" note under your listing, warn people away or drop your pages altogether, and browsers can put a full-page warning in front of the site. The longer it runs, the longer the cleanup in search results takes.
What usually causes a hacked site that redirects to spam
- An outdated plugin, theme or platform version with a known security hole
- A stolen or weak admin password, often one reused from another service
- A leaked hosting, file transfer or database login
- A nulled (pirated) theme or plugin that came with a backdoor built in
- Another site on the same shared hosting account that was compromised first
How to check for a hacked site that redirects to spam yourself
- On your phone, switch off wifi so you are on mobile data, search Google for your business name and tap your own result. Note where you end up.
- Open your homepage in a private browser window on a computer that has never been logged in to the site, and watch the address bar for a change after the page loads.
- Search Google for site: followed by your domain and look for titles or descriptions about casinos, pills, replica goods or anything you never published.
- If you use Google Search Console, open the Security issues report, which lists hacked content Google has found on your site.
- Ask a friend in another town to open the site, since some redirects only fire once per visitor or only in certain places.
How to fix a hacked site that redirects to spam
- Your developer or host takes a full backup of the site as it is now, so nothing is lost and the hacked files can be studied.
- Change every password tied to the site: the admin accounts, the hosting control panel, file transfer, the database and the email account the site sends from. Remove any admin user you do not recognize.
- Your developer finds and removes the injected code, usually in the theme files, the main configuration file, the server redirect rules or the database, then restores clean copies of the platform, theme and plugins.
- Update everything to its latest version, and delete themes and plugins that are not in use, since unused code can still be attacked.
- Once the site is clean, request a review in Google Search Console's Security issues report so the hacked warning is lifted from your search listing.
- Keep the clean backup, switch on two-step login for admin accounts, and recheck the site from a phone on mobile data over the following weeks, because hacks often return through a door that was missed.
How Prsona catches a hacked site that redirects to spam
On every scan Prsona opens your homepage as a first-time visitor and records where it ends up. When it lands on a spam site such as gambling or pharmacy pages instead of yours, Prsona raises it at the highest severity once the evidence is confirmed, quoting the destination and what was seen there, and shows a single sighting as an observation. A redirect that only fires for some visitors, such as those coming from a search result, may not show itself to any outside check, so the manual steps above are worth doing whenever you suspect a hack.
Prsona looks for a hacked site that redirects to spam as part of hacked website detection.
See where your homepage really sends a first-time visitor.
Questions about a hacked site that redirects to spam
Why does my website redirect to spam on my phone but not on my computer?
Many redirect hacks are written to avoid the people most likely to notice them. They check whether the visitor came from a search engine, is on a phone or has visited before, and only redirect the ones who fit. You, logged in on the office computer, see your normal site. A new visitor from Google on a phone gets the spam site.
Will restoring an old backup remove the hack?
Sometimes, but not reliably on its own. If the backup was taken before the hack and you also close the way in, it can work. If the attacker still has a password, or the same outdated plugin is put back, the site is usually reinfected soon after. A restore should come with new passwords and updates, not instead of them.