Why Your WordPress Site Keeps Getting Reinfected (Backdoors & Persistence)
Cleaned your WordPress site but the malware came back? Here's why sites get reinfected and how to find the backdoors that let attackers return.
You cleaned the malware, breathed a sigh of relief — and days later it’s back. A WordPress site that keeps getting reinfected isn’t bad luck; it means the clean-up removed the symptoms but left the cause. Here’s why reinfection happens and how to break the cycle for good.
The two reasons sites get reinfected
Reinfection comes down to one of two things — and often both:
- The entry point is still open. The vulnerability that let the attacker in — an outdated plugin, a weak password, an exposed file — is still there, so they simply walk back in.
- A backdoor was left behind. Attackers plant hidden persistence so that even a thorough-looking clean-up leaves them a way back. This is the part most clean-ups miss.
Where persistence hides
- Backdoor files — small, obfuscated PHP scripts tucked into
uploads/, a plugin folder or the site root, that quietly re-download the payload. - Rogue admin accounts — an extra administrator (sometimes hidden from the user list) that survives a password reset.
- Malicious scheduled tasks — a WP-Cron job that re-infects the site on a timer.
- Must-use plugins — code in
wp-content/mu-plugins/that loads automatically and can’t be deactivated from the dashboard. - Injected code in the database — that rewrites files or re-adds the admin on the next page load.
How to break the cycle
- Find every piece of persistence, not just the obvious file. Verify core integrity, scan every PHP file for backdoors, and compare against a clean file baseline to see exactly what keeps changing.
- Remove the backdoors: delete rogue admins, clear malicious cron jobs, check
mu-plugins/, and clean injected database entries. - Close the entry point: update or remove the vulnerable plugin/theme, rotate all passwords and secret keys, and harden the site.
- Take a fresh baseline and watch it. If anything changes afterwards, you’ll see it in hours — which is how you confirm the cycle is actually broken.
Forvault Security (free on WordPress.org) does the detection — integrity, backdoor scanning and change detection — read-only. For the full clean-up order see how to clean a hacked WordPress site.
The real fix for repeat infections: monitoring
Manual scans catch a reinfection only when you remember to run them — by which point the damage may be done. Continuous monitoring is what actually breaks the cycle: the Premium add-on runs scheduled scans, watches critical files like wp-config.php and .htaccess, alerts you the instant a new admin is created, and lets you quarantine a file in one click. If you’re tired of fighting the same hack, we also offer a done-for-you cleanup that includes finding the persistence for you.
Frequently asked questions
Why does my site get hacked again right after I clean it?
Because a backdoor or rogue admin survived the clean-up, or the original vulnerability is still open. Remove the persistence and close the entry point — doing only one leaves the cycle running.
How do I find a hidden backdoor?
Scan every PHP file heuristically (not just the ones you suspect), verify core integrity, and compare to a baseline. Backdoors are designed to look innocuous, so coverage matters more than guessing.
Is Forvault Security free?
Yes. The scan, core integrity check and baseline are all free on WordPress.org.