Skip to content
Rescue 404

Website Security

WordPress Malware Keeps Returning

Intermediate Risk: high

Last reviewed

Hosting access may not be needed Database access usually not needed

Direct answer

Malware keeps coming back when the cleanup removed the visible infection but left the way in: a hidden backdoor, a compromised account or credential, a still-vulnerable plugin or theme, an infected neighbor on the same hosting account, or a clean-up that was done on live files without restoring from known-good sources — so treat it as an incident, rotate every credential, rebuild from trusted code, and find the entry point before reopening the site.

If you have already cleaned your site once (or several times) and the same spam, redirects, or flagged files reappear, you are dealing with persistence, not a fresh attack. This guide explains why reinfection happens and how to break the cycle with containment, credential rotation, a trusted rebuild, and entry-point hunting. It is deliberately about recovery and prevention, not about attacker techniques.

Intermediate

Key facts

Verifiable numbers and definitions — each claim links to its source.

  • WordPress’s hacked-site FAQ says updating the secret keys in wp-config.php forces anyone who might still be logged in off the site. (WordPress — FAQ: My site was hacked)
  • WP-CLI’s core verify-checksums command verifies WordPress files against WordPress.org’s checksums, and plugin verify-checksums does the same for plugin files. (WP-CLI — core verify-checksums)
  • WordPress hardening guidance warns that DISALLOW_FILE_EDIT will not prevent an attacker from uploading malicious files, though it might stop some attacks. (WordPress — Hardening)
  • Google tells site owners to fix every issue in the Security Issues report and then select Request Review once all listed problems are resolved on all pages. (Google — Security Issues report)

What the error means

A one-time cleanup removes what you can see; reinfection means something you did not remove is still able to write files or change the database. That “something” is usually a persistence mechanism — a hidden PHP file in an unexpected folder, a modified core or plugin file, a rogue scheduled task, a must-use plugin or drop-in, a malicious administrator account, or stolen credentials the attacker simply uses again. It can also be an unrelated infection elsewhere: another site in the same hosting account, an outdated plugin with a known weakness that was never updated, an old backup restored with the infection inside, or an infected computer that saves your SFTP password. Because attackers expect cleanup, they plant several ways back in. This guide differs from the general hacked-site and malware-removal guides: those cover the first response and cleanup, while this one is about why a site that was cleaned keeps reinfecting and how to close every door for good. Because customer data, search rankings, and host suspension can be at stake, it is a high-risk situation and worth professional help if the cycle continues.

Common symptoms

  • The same spam pages, redirects, or injected scripts return hours or days after a cleanup
  • A malware scanner or the host flags the same files again, or new files in the same folders
  • Unknown administrator users reappear after you delete them
  • Core, plugin, or theme files show fresh modification dates without any update from you
  • PHP files appear in uploads, cache, or other folders where they should not exist
  • Google Search Console or Safe Browsing warnings return after being cleared
  • The host suspends the account again or sends repeated abuse notices
  • Spam email or unexpected outbound traffic resumes after a quiet period

Most likely causes

  1. 01 A backdoor or persistence file was missed in the first cleanup, so the attacker simply re-uploads the payload
  2. 02 Credentials (WordPress admin, SFTP/SSH, hosting panel, database) were not all rotated, or are still saved on a compromised computer
  3. 03 The original vulnerable plugin, theme, or core version is still installed and exploitable
  4. 04 Nulled or pirated plugins or themes that ship hidden code are still present
  5. 05 Another site or add-on domain in the same hosting account is infected and keeps reinfecting yours
  6. 06 The clean-up edited files in place instead of replacing them with known-good copies from official sources
  7. 07 A restored backup already contained the infection, or the database still holds injected content or a malicious option
  8. 08 A rogue admin user, scheduled event, must-use plugin, or drop-in recreates the infection automatically
  9. 09 File permissions or ownership let the web server write everywhere, so any foothold spreads freely

What changed before the problem started

  • The site was “cleaned” with a scan-and-delete plugin rather than rebuilt from trusted files
  • A backup from before the cleanup was restored without checking when the infection started
  • Some, but not all, passwords and keys were changed after the first incident
  • Plugins and themes were left outdated or were reinstalled from an untrusted source
  • Another site on the same account was added, migrated, or left unmaintained

Troubleshooting steps

  1. 01

    Contain the site and preserve an infected copy

    Put the site in maintenance mode or ask the host to restrict traffic if visitors are being sent to harmful pages. Before changing anything else, download a full file and database copy labeled as infected evidence and keep it offline and out of the web root. Success signal: you have a dated archive and visitors are no longer exposed.

  2. 02

    Rotate every credential and secret, from a clean computer

    Use a device you trust and change WordPress admin passwords, the hosting panel, SFTP/SSH, database user, email accounts tied to the site, CDN and registrar logins. Remove unknown users and application passwords, and replace the secret keys and salts in wp-config.php so existing sessions are logged out. Success signal: old logins no longer work anywhere and every user is accounted for.

  3. 03

    Check every other site in the same hosting account

    List add-on domains, subdomains, staging copies, and old test installs under the same account or user. An infected neighbor with write access can reinfect your site indefinitely. Clean or delete each one, or ask the host to isolate your site in its own account. Success signal: every site and folder in the account is either clean or removed.

  4. 04

    Rebuild from trusted sources instead of editing in place

    Replace WordPress core files with a fresh official package, delete and reinstall plugins and themes from their official sources or paid vendors, and keep only wp-config.php, uploads, and your content after review. Do not clean files by hand-editing suspicious lines. Success signal: code files match official packages and nothing unfamiliar remains in code folders.

  5. 05

    Audit uploads, drop-ins, and must-use plugins

    Look for PHP or other executable files inside wp-content/uploads, and for unexpected files in wp-content/mu-plugins, advanced-cache.php, object-cache.php, and other drop-ins. Quarantine rather than open or run them. Ask your host to block PHP execution in uploads if available. Success signal: only expected files remain in these locations.

  6. 06

    Review users, options, scheduled tasks, and redirects

    Remove unknown administrators, check the siteurl and home settings, active plugins list, widgets, and scheduled events for unfamiliar entries, and restore a clean .htaccess or server config if rules redirect traffic. Success signal: only known admins and tasks exist and a logged-out test shows no redirects or spam.

  7. 07

    Update everything and remove what you do not use

    Update WordPress core, remaining plugins, and themes, delete inactive ones, and confirm no nulled or abandoned software remains. Turn on automatic updates where appropriate and lock down file editing in the dashboard. Success signal: no outdated or unused components remain and Site Health shows no major issues.

  8. 08

    Monitor closely and then request review

    Run a fresh scan, then compare file lists and modification times daily for a week to see whether anything returns. Once stable, use Google Search Console’s Security Issues report to request a review if warnings were shown. Success signal: no new or modified files appear and warnings clear.

When to stop troubleshooting

Stop DIY cleanup and bring in a specialist if malware returns after a full rebuild and credential rotation, the host will not unsuspend without a professional report, payment or customer data may have been exposed, you cannot get a trustworthy clean backup, or multiple sites share the account. Preserve the infected archive, a timeline, the list of everyone with access, and any host or scanner notices.

Information to collect before requesting help

  • 01 Date of first infection and each reinfection, with examples of the malicious behavior
  • 02 What cleanup was done each time and by whom (plugin, host, freelancer)
  • 03 Scanner or host reports listing infected file paths
  • 04 List of all sites, add-on domains, and staging copies in the same hosting account
  • 05 List of every user, SFTP/SSH account, and API key with access, plus recent changes
  • 06 WordPress, PHP, plugin, and theme versions and any nulled or unsupported items
  • 07 Backup dates and whether any backup is verified clean
  • 08 Google Search Console or Safe Browsing warnings and screenshots

How a professional repairs the problem

A technician starts by containing the site and saving a forensic copy. They rotate every credential from a trusted device, scan the whole hosting account for neighbors that can reinfect, and rebuild the site from official core, plugin, and theme packages instead of cleaning files in place. They review uploads, drop-ins, must-use plugins, users, options, scheduled tasks, and server rules for persistence, verify integrity against known checksums, and use logs to find the entry point. After tightening permissions, updates, and monitoring, they watch for several days, then request search-engine and host reviews with a written report.

Frequently asked questions

Why does malware come back after I deleted the infected files? +
Deleting the files you can see rarely removes every backdoor or the way in. If a hidden file, stolen password, vulnerable plugin, or infected neighbor remains, the attacker simply restores the payload.
Is this different from the “WordPress website hacked” or “infected with malware” guides? +
Yes. Those cover first response and initial cleanup. This guide is for when cleanup was done and the infection returns, which means persistence or an unclosed entry point.
Will restoring a backup stop it? +
Only if the backup predates the infection and you then fix the entry point. A backup taken after the compromise restores the infection, and an unfixed vulnerability lets it return.
Do I really need to change every password? +
Yes — WordPress, hosting panel, SFTP/SSH, database, email, and any connected service. Do it from a clean device, because an infected computer can steal the new passwords.
Can a security plugin alone solve reinfection? +
It can help detect and block, but it will not find an entry point or fix a compromised account. Use it as monitoring on top of a trusted rebuild and credential rotation, not as a substitute.
Should I delete the whole site and start over? +
A fresh install with reviewed content is the most reliable cleanup, but you must also fix the entry point and secure the account, or the new install can be infected the same way.

Repair dispatch

Still Need Help Fixing Your Website?

If you are not comfortable editing website files, changing server settings, repairing a database, or troubleshooting a live website, professional help may prevent additional damage or downtime. We will review the problem before accepting the repair.

  • You will receive a clear explanation of the likely cause.
  • We will tell you if the issue falls outside our repair scope.
  • No additional work will be performed without approval.
  • A backup should be created whenever access and website condition allow it.

Do not share passwords through an unencrypted contact form — use Password Pusher (self-destructing link). Prefer a dedicated Rescue 404 admin account, not your personal owner login; if you cannot create one yet, we will add ours after repair.

Written by Josh

Last reviewed

Platform note: Full rescue available for WordPress and self-hosted sites. Wix, Squarespace, Webflow, Weebly, and similar closed builders have very limited backend access — fixes may not be possible. I will tell you honestly before we start.