Zac McDonaldOpen to new projects
Get a quote

My WordPress site got hacked again after a cleanup

A site that is hacked again after a cleanup almost always still has a backdoor the first pass missed, or the way in is still open. The fix is a slower second pass that assumes the first one missed something, plus finding and closing the entry point.

The problem

You paid for a cleanup, the site came back, and a day or a week later it is down or redirecting again. Cleaning only what shows up leaves the rest.

How to fix it

  1. Lock them out again, properly. Change the hosting, SFTP, database and every administrator password. Remove administrator accounts you do not recognize.
  2. Look in the uploads folder for any file ending in .php. There should be none.
  3. Check the must-use plugins folder, which runs code without showing in the plugins list, and any plugin that looks real but has no reason to be there.
  4. Read wp-config.php, .htaccess, .user.ini and php.ini. These can load malicious code before WordPress starts.
  5. Check WordPress and every plugin from WordPress.org against the official checksums, without loading any plugin or theme:
    wp core verify-checksums --skip-plugins --skip-themes
    wp plugin verify-checksums --all --skip-plugins --skip-themes
    Replace plugins that are not on WordPress.org with a fresh copy from the maker.
  6. Search the database for injected scripts, odd scheduled jobs, and administrators nobody created.
  7. Check every other site on the same hosting account. One infected site can reinfect the rest.
  8. Close the door. Update or remove vulnerable plugins, and ask the host for access logs from the day it came back. The request that let them in is usually there.

When to stop

If a cleanup has already failed once, repeating it the same way will probably fail the same way. Stop when the host’s backups may be infected or several sites share the account.

Or I can do it for you

You do not have to go through this yourself. If it is happening now, send an emergency request. I move fast on emergencies, and the emergency fee is credited toward the cleanup. See hacked site recovery and WordPress security, or get a quote.

This happened

A small business site went down with several backdoors, hundreds of tampered configuration files, about a dozen fake plugins and two administrator accounts nobody had created. I cleaned it and reinstalled WordPress from checksum-verified copies. The next day it was down again. A second, slower pass found about half a dozen more backdoors, one that could pull new malicious code in by itself. I then added a firewall, switched off XML-RPC, replaced the security keys and tightened permissions. It scanned clean. How the attackers first got in was never confirmed.

Get the hacked-site first-hour checklist

This adds you to my mailing list. Every email has a link to leave it. Privacy policy