Key Takeaways

  • Redirect malware can hide from the site owner. In many versions of this attack, only visitors who come from Google are sent to the spam site.
  • Restoring a backup isn’t always enough. In this case, a hidden script kept rebuilding part of the infection.
  • Attackers name their files to look like WordPress core files, so a quick look at the server won’t catch them.
  • After a cleanup, change every password, turn on two-factor authentication and update everything: plugins, theme, WordPress and PHP.
  • Most WordPress hacks start with outdated plugins. Regular updates and off-site backups are the cheapest protection.
Table of Contents

A business website suddenly started sending its visitors to a betting site, and its owner couldn’t log in to WordPress. The malware was removed, but restoring a backup alone wasn’t enough. Here’s what was hiding on the server, how the site was cleaned, and what to check on your own site.

What happened

In November 2026, a business website started redirecting its visitors to an online betting platform. The owner couldn’t reach the WordPress dashboard either, because the admin pages redirected too. New folders had also appeared on the server, named after the site’s own pages.

It was caught within a day, before it could spread further. That made it possible to restore an earlier backup, which turned out to be only the first step.

How this malware hides from the site owner

This kind of attack is often called SEO spam or a link farm. The goal is to borrow the reputation of a legitimate website and send its search traffic somewhere else, usually to betting, pharmacy or other spam sites.

What makes it dangerous is that it can show different things to different visitors, a technique called cloaking. Aleksa has cleaned up the same attack pattern on another site before. In its most common version:

  • visitors who type the address or use a bookmark see the normal site
  • the owner logging in to WordPress sees nothing unusual
  • visitors who come from a Google search land on the spam site

The owner checks the site, everything looks fine, and meanwhile new customers from search are being sent away. In this case, the redirect also hit the admin area, which is exactly why it was noticed so quickly.

Who sees what
Same website, three different results
Types the address
or uses a bookmark
Sees the normal site
Site owner
logged in to WordPress
Sees nothing unusual
Visitor from Google
clicks a search result
Lands on a spam site
The most common version of this attack. In this case, the site owner was redirected too.

What was hiding on the server

Attackers don’t name their files “malware.php”. They copy the names of real WordPress files, so a quick look at the folder list doesn’t raise any flags. Here’s what was found, next to what each file was pretending to be:

The site’s root folder
What didn’t belong there
.wp-config/hidden folder
.owner_ip
audit.log
cloak.lock
perde.html
about/ · contact/ and other page foldersfake page folders
wp-admin/
wp-content/
cron-settings.phprebuilds the infection
wp-includes/
default.phpnot a WordPress file
index.php
index.phpoldnot a WordPress file
loaded.phpnot a WordPress file
wp-activate.php
wp-active.phplookalike
wp-class-cas.phplookalike
wp-config.php
Red = not part of a standard WordPress installation. Everything else is a normal WordPress file or folder.

The exact role of every file can only be confirmed by analyzing its code. But the pattern is clear: everything was named to blend in.

Why restoring a backup wasn’t enough

Restoring the backup removed most of the damage and brought the site back online. Two things survived it: the cron-settings.php file in wp-content and the hidden /.wp-config/ folder. The script was rebuilding the contents of that folder, which is how this kind of malware keeps coming back after a cleanup.

Both had to be found and removed by hand. If they had stayed, the infection could have returned, and the backup would have given a false sense of safety.

There was some good news. This type of attack usually controls only the website’s files. It doesn’t take over the hosting account itself. It can reach the database, though, because the site’s files contain the database login, so the database was checked as well. No signs of compromise were found there.

How the site was cleaned, step by step

Once the leftovers were gone, the rest of the cleanup was about closing every door the attacker could use again:

Cleanup checklist
Restore a backupAn earlier copy of the site files.
Remove what the backup missedcron-settings.php and the hidden /.wp-config/ folder.
Update everythingPlugins, theme and WordPress core. PHP moved to 8.5.
Change every passwordWordPress, database, hosting, FTP, SFTP and SSH.
Reset keys and turn on 2FANew security keys and salts log out every session.
Check cron jobs and .htaccessPlus a review of the PHP files in the root.
Scan with WordfenceNo remaining threats were found.
Check Search ConsoleLook for spam URLs in Google’s index.

After the cleanup, the plugins, theme, WordPress core and PHP version were all up to date. If your own site still runs an older PHP version, read what changes when PHP 8.2 reaches end of life.

How the attacker likely got in

The exact entry point wasn’t confirmed, which is common. By the time an infection is found, the trail is often gone. These are the usual ways in:

  • Outdated plugins and themes. According to Patchstack, 11,334 new vulnerabilities were found in the WordPress ecosystem in 2025. 91% were in plugins, 9% in themes, and only 6 in WordPress core. For the most heavily exploited ones, the median time to mass attacks was 5 hours.
  • Outdated PHP or WordPress versions that no longer get security fixes.
  • Stolen passwords for WordPress, FTP or the hosting account.
  • No two-factor authentication on admin and hosting accounts.

Signs your WordPress site may be hacked

You don’t need a developer for a first check:

  • Open your site from a Google search on your phone, in a private window. Don’t just type the address.
  • Search Google for site:yourdomain.com and look for pages you didn’t create.
  • Check Google Search Console for security issues or manual actions.
  • Look at the files in your hosting file manager. New folders in the root, or files with names very close to WordPress files, are a warning sign.
  • Watch for a sudden drop in search traffic, or customers telling you your site looks strange.

Regular maintenance: do it yourself or hand it off

Most of the work in this cleanup is the kind of work that prevents a hack in the first place. Whoever does it, a WordPress site needs the same things:

Regular maintenance
Two ways to keep your site safe
Do it yourself
Free, but it takes time and a schedule
weeklyUpdate plugins, theme and WordPress
dailyBack up outside the server
onceTurn on 2FA everywhere
alwaysMonitor uptime and security
yearlyKeep PHP on a supported version
Hand it off
A team takes care of it for you
Updates checked before they go live
Backups stored outside the server
Security and uptime monitoring
Development hours for changes
A free site review to start

Doing it yourself works if you have the time and stick to a schedule. If you’d rather hand it off, our WordPress maintenance plans start at $200 a month, and every plan begins with a free site review.

FAQ

How do I know if my WordPress site is hacked?

Common signs are visitors landing on a different site, pages you didn’t create showing up in Google, security warnings in Search Console, and unknown files on the server.

Why does my site only redirect visitors from Google?

Many redirect hacks check where a visitor came from. Visitors from search are sent away, while the owner, who types the address or logs in, sees the normal site.

Is restoring a backup enough to remove malware?

Not always. Some malware leaves files outside the restored folders or rebuilds itself. After a restore, check the server for leftovers and change every password.

Can WordPress malware reach my database?

Yes, because the site’s files contain the database login. That’s why the database password should be changed and the database checked after any hack.

What should I change after a WordPress hack?

Every password: WordPress admins, database, hosting account, control panel and FTP or SFTP. Also regenerate the WordPress security keys and salts and turn on two-factor authentication.