My WordPress site’s been hacked. Now what?
The 30-second version
Don’t panic-delete. First back up the hacked site and take screenshots: that’s your evidence. Turn on maintenance mode so visitors are safe, and tell your host. Lock the hosting account first, because that’s usually the way in: new passwords and 2FA for everyone. Then find everything the attacker added (users, SFTP logins, plugins, must-use plugins, connectors) and remove it, change the secret keys, scan, and work out how they got in.
On this page
It was about 3pm on a Friday. (All the bad bugs show up at 3pm on a Friday.) A client was having trouble viewing one of their pages, one with a custom feature we’d built for them the year before, and they wanted to update it. They’d sent a screenshot of what they were seeing.
So I did what I always do: I pulled a copy of the site onto my computer with Local and opened the same page. Instead of the page, I got a Cloudflare “verify you’re human” check.
On my computer. On a copy of the site that only existed on my computer. Why the heck was Cloudflare running on my local setup? Then it clicked, and my stomach dropped. That check wasn’t Cloudflare at all. It was part of the site, and someone had broken in to put it there.
This post is the plan I followed that afternoon, written so you can follow it calmly on your own worst day. The identifying details are left out, but the steps are real. It’s written for WordPress sites, though a lot of it applies to any website.
What happened
Here’s the short version:
- Someone got hold of a login to the hosting dashboard. It belonged to the client and didn’t have two-factor authentication. We still don’t know how the password leaked.
- From the dashboard, they created their own SFTP users on two sites in the same hosting account.
- They uploaded a plugin with an innocent-sounding name and created a new admin user in WordPress.
- They installed a remote management connector, a plugin meant for agencies that look after lots of sites, so they could get back in even if someone changed the passwords.
- They dropped a file into must-use plugins (
mu-plugins), a folder WordPress loads automatically and that you can’t switch off from the admin. - The plugin showed visitors a fake Cloudflare “verify you’re human” page. It also had a backdoor: a way to log in as an admin without a password.
How one stolen login became a hacked site
- Stolen loginThe hosting dashboard, no 2FA
- New SFTP usersTheir own way into the files
- Hidden pluginsOne normal, one must-use
- New admin userPlus a remote connector
- Fake checkShown to every visitor
This is a really common pattern right now. Security agencies like New Zealand’s NCSC have been warning about hacked WordPress sites showing these fake checks, and researchers say many of them weren’t broken into with some clever bug. Someone just logged in with a stolen password.
How does a hacked site stay hacked?
Imagine a burglar who copies your house keys, and on the way out also unlocks a back window. Changing the front door lock isn’t enough. You have to find every window they left open.
Those extra ways back in are called persistence: extra users, SFTP logins, connector plugins, must-use plugins, backdoors. Cleaning up a hacked site means finding every single one.
What’s ClickFix?
It’s a fake “prove you’re human” box that asks you to press a few keys. The moment you tick the box, the page secretly copies a command to your clipboard. The keys open a box on your computer, paste that command, and run it. The command usually installs something that steals passwords.
So the real victim isn’t the website. It’s whoever visits it. And real checks never ask you to press keys or run anything, on any site.
Here’s a harmless fake one you can try:
FAKE: a harmless demo. Nothing gets copied or run.
Verify you are human
example-bakery.com needs to review the security of your connection before proceeding.
The response, step by step
Work through these in order. The order matters: save the evidence first, then lock the hosting account (the front door), then clean WordPress (the rooms inside).
Step 1:Don’t delete anything yet
It’s tempting to start ripping things out. Don’t, not yet. First take a full backup of the hacked site, files and database, and download a copy.
Then take screenshots of the WordPress user list, the plugin list (including the Must-Use tab) and the SFTP users in your hosting dashboard. That’s your evidence of what was added and when. You’ll need it to work out how they got in, and to show the host and the client what you did.
Label the backup clearly, like “HACKED: do not restore”, so nobody puts it back by accident later.
Step 2:Turn on maintenance mode
Every visitor who sees the fake check could become a victim. Turn on maintenance mode while you clean, so visitors get a simple “back soon” page instead.
A maintenance-mode plugin is the easy way. If you’re comfortable with the command line, WP-CLI’s wp maintenance-mode activate is even better here, because WordPress checks for it before it loads any plugins, including the bad one.
Step 3:Tell your host
Most managed hosts have a security team, and this is exactly what it’s for. Open a ticket early, even if you plan to do the cleanup yourself.
WP Engine offered to clean the site for me. By then I’d done most of the work, so I sent them a list of everything I’d removed and why. They checked it over and told me I’d followed all the right steps.
Step 4:Lock the hosting account
This is the front door, and it’s how they got in. Remove or disable the login that was used, reset every remaining password, and turn on two-factor authentication (2FA) for every user.
If the login belongs to the client, like it did for me, walk them through it: a new password, 2FA, and a check of anywhere else they used the same password.
Step 5:Remove SFTP and SSH users you don’t recognise
Check every site in the hosting account, not just the one that looked hacked. In my case, the attacker had made SFTP users on two sites. Reset the passwords of the ones you keep.
Step 6:Deal with WordPress users
Go to Users and filter by Administrator. For any admin you don’t recognise, change their role to Subscriber first. That stops them doing anything, but keeps their details so you can note when they were created. Then delete them.
When WordPress asks what to do with their content, look at it before you hand it to another user. Then reset the passwords of every real admin.
Malware can hide its admin from this list. The command line box further down has a way to see everyone.
Step 7:Remove plugins you don’t recognise, and check the folders
Check the Plugins screen, including the Must-Use tab. Then check the folders themselves over SFTP: wp-content/plugins and wp-content/mu-plugins. Malware can hide from the admin screens, but it can’t hide from the folder.
Some hosts put their own files in mu-plugins (WP Engine does), so check with your host before deleting anything you don’t recognise there. Download anything suspicious into your evidence folder before you delete it.
Step 8:Remove remote management connectors
Plugins like ManageWP Worker or MainWP Child let a dashboard somewhere else control the site. Great for agencies, perfect for attackers. If nobody on your team installed it, remove it.
Step 9:Change the secret keys
wp-config.php holds eight secret keys and salts that WordPress uses to sign login cookies. Replace them all with fresh ones from WordPress’s key generator and everyone is logged out straight away, including the attacker, even if they’d stolen a logged-in session.
Anyone with file access could also read the database password in that file. Ask your host to change it, and update wp-config.php to match.
Step 10:Scan, and compare against clean copies
Run a scan: your host’s scanner if it has one, or a security plugin like Wordfence or Sucuri. Then check that WordPress’s own files haven’t been changed.
If you have SSH access
These WP-CLI commands compare your files against clean copies from WordPress.org, and list every admin without loading plugins, so malware can’t hide any:
# WordPress's own files (doesn't check wp-content)
wp core verify-checksums
# Plugins from wordpress.org
wp plugin verify-checksums --all
# Every admin, with plugins and themes switched off
wp user list --role=administrator --skip-plugins --skip-themesNot comfortable on the command line? Ask the DevOps person on your team, or your host’s support. (This post covers the terminal basics.)
Step 11:Work out how they got in
Look at the host’s access logs and the dashboard’s activity log: which account was used, from where, and when. Your evidence screenshots help here, because new users and plugins show when they were created.
In my case it was the client’s hosting login. We never found out how that password leaked, so the fix was a new password, 2FA, and a check of everywhere else they’d used it.
Step 12:Afterwards: the site, Google and the paper trail
- Turn maintenance mode off and check the site the way you would after any deploy.
- Check Google Search Console under Security & Manual Actions → Security issues. If Google flagged the site, click Request Review, but only once it’s fully clean. Asking too early slows down the next review.
- Tell the client what happened, what you did, and what they need to do (new password, 2FA).
- Write a timeline: when it started, when you found it, and what you removed. Mine went to the host too.
What could go wrong
Restoring a backup that already had the malware
The attacker may have been in for days or weeks before anyone noticed. Check the dates on the new users and files, and only restore from before then.
Cleaning WordPress but not the hosting account
If the stolen dashboard login still works, they’ll come straight back and do it all again.
Two people cleaning at once
Your host may offer to clean up too. Agree who’s doing what, and send them your list. Because I’d already cleaned everything, the host found no signs of compromise when they looked. Without my list, nobody could have told “cleaned” apart from “never hacked”.
Deleting the evidence
Delete first and you lose the trail: when it started, which account was used, what was added. Back up and take screenshots first, every time.
Leaving it until Monday
Mine started at 3pm on a Friday. Leaving it over the weekend would have meant two more days of visitors seeing the fake check, and I wasn’t going to leave the site like that. If you can’t finish, at least get maintenance mode on.
Stopping it happening again
Lock the front door
Turn on 2FA for the hosting dashboard, your email and every WordPress admin. Give everyone who can log into the hosting dashboard their own login, so you can remove one person without changing everyone’s password.
Shared logins, like one SFTP login per site, belong in a password manager, and get changed whenever someone leaves.
Fewer doors
Remove users, SFTP logins, plugins and themes you don’t use. A deactivated plugin is still on the server, and it can still be attacked. And never install “nulled” (pirated) premium plugins: they often come with malware built in.
Keep a record
An activity log plugin records who did what and when, which makes the next investigation much faster. And keep backups somewhere other than the server itself.
What I’d tell past me
Learn to recognise the common scams. The client’s screenshot should have been enough to tell me what was going on: a “verify you’re human” box with keyboard instructions on it is never real. It only became an “aha!” when I saw it running on my own computer.
If you’re reading this on your own bad Friday: breathe, back up, then lock the front door. You’ve got this.