Guides · ← All guides
WordPress Site Keeps Getting Hacked After Cleanup
Published: November 19, 2026 · 8 min read
You clean the site. You change the passwords you remember. For a day or two, everything looks fine. Then the redirects are back, or the spam pages are back, or your host emails you again. It feels like the attackers keep breaking in. Usually they are not breaking in at all. They never fully left.
Why deleting files is not enough
Modern WordPress malware is built to survive a file cleanup. Security researchers at Sucuri have documented strains that keep copies of themselves in several places at once, so when one copy is deleted, another copy quietly writes it back. The visible spam file is the least important part of the infection. The important part is whatever has permission to recreate it.
That means a real cleanup is a hunt for persistence, not a hunt for spam. Here are the six hiding places that get missed most often.
The six hiding places
1. Must-use plugins
Files in wp-content/mu-plugins run automatically on every page load, and they do not show up in the normal plugins list the way owners expect. An attacker who drops a file there gets code that runs before almost everything else — and survives theme and plugin reinstalls.
2. Rows in wp_options
The database is a hiding place too. Autoloaded options can carry encoded payloads that get unpacked on each request. A cleanup that only scans files never looks here, which is exactly why attackers use it.
3. WP-Cron jobs
WordPress has its own scheduler. A rogue cron entry can re-download the infection on a timer, so the site looks clean right after you check it and dirty again by morning. Review the scheduled hooks, not just the files.
4. Hidden admin accounts
A second administrator account — sometimes with a name one letter off from yours — is a standing invitation back in. So are application passwords created during the infection. List every admin user and every application password, and remove any you do not recognize.
5. .user.ini and auto_prepend tricks
On many hosts, a .user.ini file can tell PHP to run a chosen file before your site's own code, through the auto_prepend_file setting. One small file in the web root can quietly front-run the whole site.
6. The uploads folder
wp-content/uploads should hold images and media, never PHP. Attackers know cleanup tools often skip it because it is full of legitimate files. Any PHP file in uploads deserves a hard look.
The order that actually ends it
Work in this order. First, take the site offline or put it behind a maintenance page, so you are not cleaning a moving target. Second, hunt the six hiding places above and remove what does not belong. Third, change every credential that touches the site: WordPress admins, the database user, FTP and hosting accounts, and delete application passwords you did not create. Fourth, update WordPress core, themes, and plugins, and remove any theme or plugin you no longer use — the original entry point is often an old, forgotten one. Fifth, and this is the step the whole cycle usually skips, verify from outside. The hub's incident guide covers the whole response sequence — what to do in the first 24 hours when your website is hacked — in the order it has to happen.
Verify from outside — the step that proves it
A scanner that runs inside WordPress reads the site through WordPress. If the infection is still present, it can hide from exactly that kind of check. An external scan has no code on your server and nothing to hide from: it looks at your site the way the public internet does.
That is BreachHunter's honest role here, stated plainly: BreachHunter does not remove malware, and it is not a firewall. It is a website security test that runs from outside your site and reports what is actually exposed — open ports, leaked files, missing headers, TLS problems — with evidence for each finding. Run it after a cleanup and it is a second opinion that does not depend on the health of the site it is checking. If the report is clean and stays clean on a re-scan, your cleanup held. Our explainer on what a website security assessment actually tests covers what that outside view can and cannot see. If the red warning is already up in browsers, read Google blacklist removal next — the order there matters.
Frequently asked questions
Why does my WordPress site keep getting hacked after I clean it?
Because most cleanups remove the visible malware and miss the thing that puts it back: a hidden admin account, a rogue cron job, a malicious must-use plugin, or a backdoor stored in the database. Until that persistence mechanism is gone, the site re-infects itself, sometimes within hours.
Can BreachHunter remove the malware for me?
No. BreachHunter is an external scanner, not a cleanup service and not a firewall. What it does is check your site from the outside, the way an attacker sees it, so you can confirm a cleanup actually worked and catch the exposures that let the infection in.
How do I know the cleanup really worked?
Verify from outside the site itself. Tools that run inside a compromised WordPress install can be lied to by the infection. An external scan checks what the public internet can actually reach: exposed files, open ports, headers, and known-bad paths, with nothing installed on the server.
Run a free BreachHunter scan on your site →
Write the incident timeline while you clean
Mid-cleanup is the worst time to rely on memory, and the timeline is what turns a stressful week into evidence. Keep a plain note as you work: when the compromise was noticed, what you found in each hiding place, what you changed and when, and the password and key rotations with their times. Ten lines is enough.
You will use it three ways. Your host or developer can spot the step that was missed. Your customers get a straight account instead of a shrug. And if the site is flagged again, the timeline is the difference between starting the investigation from zero and starting from 'here is everything that was already ruled out'.
Sources
The authorities this guide is built on, in the form we check our own work against:
- WordPress.org — FAQ: My site was hacked (2025) — the official cleanup guidance this sequence extends.
- WordPress Developer Handbook — Hardening WordPress (2025) — file permissions, updates and access controls.