WordPress Security ServicesMalware Removal
After the Cleanup

How to Secure WordPress After a Hack: The Post-Infection Checklist

The malware is gone. That's the hardest part, but it isn't the end. A cleaned site with the same passwords, the same outdated plugin and nobody watching it is a site that gets hacked again, often within weeks. Here's the post-hack checklist I go through with every client after a cleanup.

Sergey By Sergey, WordPress security specialist Updated 3 min read
In this guide
  1. 1. Lock out the attacker completely
  2. 2. Close the hole they came in through
  3. 3. Harden the basics
  4. 4. Start fresh with backups
  5. 5. Clean up the outside world
  6. 6. Watch closely for 30 days
  7. Want this done and kept up for you?

1. Lock out the attacker completely

Do this first, because a valid login lets an attacker back in without any malware at all.

  • Change every password: hosting control panel, SFTP/SSH users, the database, every WordPress administrator and editor, and the hosting email account.
  • Revoke application passwords before anything else, because they keep working after a password change: Users → Profile → Application Passwords, or wp user application-password delete <user> --all.
  • End all login sessions and replace the security keys: wp config shuffle-salts signs everyone out.
  • Remove unknown users, including accounts that look like they belong to WordPress, your host, or “support”.
  • Reconnect remote services with fresh keys: management dashboards, backup services, SMTP and API keys stored in plugins.
  • Tell everyone who logged in while the site was infected to close all its tabs, clear the site’s data in their browser, and change any password they typed in during that time.

2. Close the hole they came in through

A cleanup that doesn’t find the entry point is a temporary cleanup. Usually it’s one of these: an outdated plugin or theme with a known vulnerability, a nulled (pirated) plugin, a weak or reused password, or another site in the same hosting account. Fix it:

  • update WordPress, every plugin and every theme;
  • delete plugins and themes you don’t use, because deactivated still means attackable;
  • replace nulled software with genuine copies, or remove it;
  • clean, or remove, every other site in the same hosting account.

3. Harden the basics

  • Turn on two-factor authentication for every admin.
  • Add define( 'DISALLOW_FILE_EDIT', true ); to wp-config.php.
  • Block PHP execution in wp-content/uploads.
  • Set sensible file permissions (folders 755, files 644, wp-config.php as strict as your host allows).
  • Put a firewall in front of the site, either a security plugin or a cloud firewall.
  • Remove file manager plugins once you don’t need them.

The full list, with code snippets, is in my WordPress security checklist.

4. Start fresh with backups

Your old backups may contain the malware. Make a new full backup of the clean site and label it clearly. That’s your new baseline. Then set up automatic off-site backups that go back several weeks, so a future problem never forces you to restore an infected copy.

5. Clean up the outside world

  • Google Search Console: request a review if there was a security warning, remove unknown owners, and submit your sitemap.
  • Hosting provider: if the site was suspended, send them a summary of what was removed.
  • Blocklists: check whether antivirus vendors still flag the site. See antivirus and browser warnings.
  • Email: if the site was sending spam, check your domain and server IP against spam blacklists.
  • Customers: if personal or payment data may have been exposed, check your legal obligations.

6. Watch closely for 30 days

Reinfections usually show up within the first days or weeks:

  • run a malware scan daily or weekly;
  • check Users and recently modified files every week;
  • keep Search Console alerts on, and add uptime monitoring;
  • test the site on a phone through a Google search now and then.

If the same problem returns, something was missed. See why WordPress malware keeps coming back.

From my cleanup work: the reinfection I see most often after someone else’s cleanup isn’t clever malware. It’s an attacker logging in with a password that was never changed, or an application password nobody knew existed. Step 1 alone prevents a large share of repeat hacks.

Want this done and kept up for you?

Everything on this page is part of my malware cleanup, and the security care plan keeps it in place every month afterwards.

Sergey, WordPress Security Specialist
About the author
Sergey, WordPress Security Specialist

10 years in WordPress security and incident investigation, and more than 200 websites cleaned of malware. Top Rated on Upwork with a 100% Job Success score. More about me

Frequently Asked Questions

How soon after a cleanup should I do this?

Immediately, ideally as part of the cleanup itself. Credentials and sessions especially: the attacker may still have a valid login or saved password, and that's the fastest way back in.

Do I really need to change every password?

Yes. You usually can't tell which passwords the attacker saw. Malware often records logins typed while the site was infected, and wp-config.php contains the database password in plain text. Change them all once, properly, and you remove the guesswork.

My site was cleaned by my host. Is it secure now?

Not necessarily. Host cleanups usually remove the files their scanner flagged. They rarely change your WordPress passwords, find the vulnerable plugin, or check the database. Work through this checklist anyway.

How do I know the site stays clean?

Watch it: scheduled malware scans, Search Console alerts, uptime monitoring, and a look at your admin users and recently changed files every week or two for the first month.

Need a hand?

Let me clean your WordPress site for you

Send me your site URL and what you're seeing. I'll reply with what I think is going on and the next step.

$95 per infected site · 1-month guarantee · direct contact with the specialist

Get My Site Cleaned →