Redirects only some visitors see
People on phones, or arriving from Google, get sent to spam or scam pages. You, logged in on a desktop, see nothing wrong. That selectiveness is deliberate.
To clean malware from WordPress yourself: back up the infected site, take it offline to visitors, replace WordPress core, plugins and themes with fresh copies from their source, hunt the backdoors in uploads, mu-plugins, .htaccess, the database and cron, remove rogue administrators, rotate every password and salt, update everything, then ask Google to review the site.
Removing the malware you can see is the easy half. Cleanups fail on what gets left behind: a second backdoor, a payload in the database, or the way in that nobody closed.
Plenty of things look like a hack and are not: a plugin update that broke a page, an expired domain, a hosting outage. These four signs, on the other hand, almost always mean an infection.
People on phones, or arriving from Google, get sent to spam or scam pages. You, logged in on a desktop, see nothing wrong. That selectiveness is deliberate.
Search site:yourdomain.com. Pharmacy, casino, replica-goods or Japanese-language listings under your domain are spam pages injected into the site.
A red "Deceptive site ahead" screen, a Security issues notice in Search Console, a suspension email from your host, or mail bouncing because the domain is on a blocklist.
An administrator you do not recognise, PHP files inside the uploads folder, or a plugin nobody remembers installing.
A free remote scan: Google Safe Browsing, spam blocklists, injected code in the page source, security headers and exposed WordPress endpoints. Run it now, and again when you finish step 10. It only sees the public surface, so a clean result does not clear the files or the database.
Ten steps, in this order, and the order matters. Change passwords while a backdoor is still in place and the attacker simply reads the new ones. Ask Google for a review before the site is clean and the request is turned down. Commands use WP-CLI where it saves time; every step can also be done over SFTP and phpMyAdmin.
Stuck halfway?
Stop where you are and tell us which step you reached. We pick it up from there.
Hand it to DelvokCopy every file and export the database, exactly as they are now, malware included. This copy is your evidence and your way back if a cleanup step breaks the site. It is not something you restore later without thinking: if the infection is weeks old, every recent backup your host made has the same malware in it.
wp db export ~/before-cleanup.sql
# then download it and delete the server copyWhere this goes wrong: Hosts often keep only 7 to 30 days of backups. Infections usually start before anyone notices them, so the "clean" restore point may already be gone.
While you work, visitors should not be redirected to spam or served infected scripts. Use a maintenance page set at the server or hosting panel, not a WordPress plugin: a plugin runs inside the compromised install and can be bypassed by it. Then change the hosting panel password and look for SFTP, SSH or database users you did not create.
Where this goes wrong: Running the cleanup from a computer that is itself infected, or from a browser with a saved, leaked password, undoes everything that follows.
Do not hunt through core files line by line. Ask WordPress which files differ from the official release, then replace wp-admin, wp-includes and the root files with a fresh copy of the same version from wordpress.org. Keep wp-config.php, but read it top to bottom yourself: an extra include or a long encoded string near the top is a classic hiding place.
wp core verify-checksums
wp core download --force --skip-content --version=$(wp core version)Where this goes wrong: Extra files the checksum report lists as "should not exist" are not harmless leftovers. Find out what each one is before deleting it.
Treat every plugin and theme folder on the server as untrusted. Reinstall free ones from wordpress.org and paid ones from the vendor account you bought them from, never from the copy already on the server and never from a "nulled" download. Delete anything inactive or abandoned outright: an old plugin you forgot about is one of the most common ways in.
wp plugin verify-checksums --all
wp plugin install <slug> --forceWhere this goes wrong: Some malware installs itself as a plugin and hides from the Plugins screen. Compare the folders in wp-content/plugins with the list WordPress shows you.
The visible infection is usually the noisy part. The backdoor that lets the attacker back in is small, quiet and placed where nobody looks. Check the places that load code without appearing anywhere in the dashboard, and anything that changed recently.
find wp-content/uploads -type f -name "*.php*"
ls -la wp-content/mu-plugins
find . -type f -name "*.php" -mtime -30Where this goes wrong: Attackers set file dates to match the files around them, so "modified recently" finds only the careless ones. Use it as a lead, not a verdict.
Files are only half the site. Malware also lives in the database, where file scanners never look: encoded payloads in wp_options rows that load on every page, scripts injected into post content, and a changed siteurl. Then check WP-Cron and the server crontab for jobs that quietly reinstall everything you just removed.
wp db query "SELECT option_name, LENGTH(option_value) AS size FROM wp_options WHERE autoload IN ('yes','on') ORDER BY size DESC LIMIT 20"
wp db search "<script" --all-tables
wp cron event listWhere this goes wrong: Your table prefix may not be wp_. Check $table_prefix in wp-config.php, and never delete an option you cannot identify without the backup from step 1 in hand.
List every user with administrator rights and question each one. Attackers create accounts with believable names like "support" or "wpadmin", and some quietly add powerful capabilities to an ordinary subscriber account, so it never appears in a list of administrators. Delete what you cannot vouch for and reassign its content to a real person.
wp user list --role=administrator --fields=ID,user_login,user_email,user_registeredWhere this goes wrong: Deleting the account is not enough while its login session is still valid. That is what step 8 is for.
Assume every credential the site could read has been copied. Change them after the removal work, not before, or a surviving backdoor simply reads the new ones. Start with the hosting panel and work inward. New salts in wp-config.php sign everyone out, the attacker included.
wp config shuffle-saltsWhere this goes wrong: Reusing a password from another site, or from before the hack, hands the attacker the new door key.
A cleanup that does not find the entry point has only reset the clock. Update core, every plugin and theme, and the PHP version. Then work out how they got in: a known-vulnerable plugin, a reused password, an abandoned theme, or another site in the same hosting account. If you cannot name the cause, assume the door is still open and harden accordingly.
wp config set DISALLOW_FILE_EDIT true --rawWhere this goes wrong: One infected site in a shared hosting account can reinfect every other site in it. A forgotten /old or /dev folder counts.
Only once the site is clean, ask for the warnings to come off. In Google Search Console, open Security issues and request a review, saying what you found and what you fixed. Remove or return 410 for any spam pages that got indexed, and resubmit your sitemap. Check Spamhaus and other blocklists your email depends on. Then watch closely for a few weeks: new files, new admins, new redirects.
Where this goes wrong: Requesting a review while anything is still infected gets the request rejected and can slow down the next one. Google sets its own timeline; nobody can promise a date.
Attackers rarely leave one way back in. Remove the obvious file and the quiet one in mu-plugins or wp_options reinstalls everything, often the same week.
The vulnerable plugin, the reused password, the abandoned theme. Clean around an open door and the next automated scan walks straight back through it.
A forgotten staging copy or second install in the same account, or a server that was itself the problem, will reinfect the cleaned site from next door.
The infection is usually older than the first symptom. Restoring last week’s backup can bring back exactly what you just removed.
Plenty of legitimate plugins use base64 and eval. Remove every match and the site breaks, and you still have not proven the malware is gone.
Remote scanners, ours included, see only the public surface. A backdoor that is waiting quietly shows nothing at all from the outside.
If the malware has already come back once, or you have found more than you expected, that is the moment to hand it over.
Have Delvok finish the cleanup$0
Follow the ten steps above, in order.
$1,250flat, launch pricing (normally $2,500)
Most rescues start the same day and are cleaned within 24 to 48 hours.
“Amazing service. They were able to fix and take the malware off my site.”
“They helped clean up my site after it was hacked. Quick and easy.”
Yes, if you can reach the files over SFTP or SSH, can open the database, and are willing to be methodical. The steps on this page are the same ones a professional follows. Where DIY cleanups usually fail is not the removal itself but the parts that are easy to skip: the second backdoor, the database payload, and the way in that nobody closed.
Doing it yourself, plan for most of a day on a small site if you are comfortable with SSH and WP-CLI, and longer without them or on a large WooCommerce store. If Delvok does it, most rescues start the same day and the site is cleaned within 24 to 48 hours.
Partly. A security plugin runs inside the WordPress install it is trying to clean, so it can be disabled or fooled by what it is looking for. Plugins are good at spotting known malicious files; they are weaker at database payloads, server crontabs and code outside the WordPress folder. Use one as a second opinion, not as the cleanup.
Only if you know the backup is older than the infection, and only if you then fix how the attacker got in. Otherwise you restore the same backdoor, or the same vulnerable plugin, and the site is reinfected. Infections are often weeks old before the first symptom appears.
Almost always one of four reasons: a backdoor was missed, the entry point is still open, a scheduled task re-downloads the malware, or another infected site in the same hosting account is spreading it back. Reinfection within days points to something left behind, not to a new attack.
Once the site is genuinely clean, open Security issues in Google Search Console, describe what you found and fixed, and request a review. Google decides how long the review takes. Anyone who promises a removal date is guessing.
A Complete Malware Rescue is a flat $1,250 at launch pricing (normally $2,500). It covers inspection of files, database, users and scheduled tasks; removal of malware, backdoors and rogue accounts; hardening; Google review requests; and a move to isolated managed hosting, which continues from $150 a month.
Delvok, a WordPress malware rescue and secure hosting service. We clean infected WordPress sites for a living, and we would rather you fix yours properly than half-fix it. If you get stuck, or find more than you expected, we can take it from wherever you stopped.
Tell us what you found and which step you reached. Delvok finishes the cleanup, closes the way in and moves the site somewhere it is watched, for a flat $1,250.