Tips & How-TosNovember 17, 20265 mins read

My WordPress Site Was Hacked: What to Do in the First Hour

Your WordPress site was hacked. Here's what to do in the first hour, in the right order, and how to keep it from happening again.

Craig Diehl
Founder & Developer, Granite Cloud & Code
My WordPress Site Was Hacked: What to Do in the First Hour
The first hour after a hack is about not making it worse.

If your WordPress site was hacked, don't start deleting files. First, save a copy of the site as it is. Then change your passwords, starting with your email account, and check for admin users you didn't create. After that, restore a clean backup or clean the site, fix whatever let the attacker in, and ask Google to remove any warning. Done in that order, most small business sites recover in a day or two without losing anything important.

Take a breath. This happens to a lot of sites, and it's fixable. Here's the order that keeps a bad day from getting worse.

Signs Your WordPress Site Has Been Hacked

You might be hacked if you see any of these:

  • Google shows "This site may be hacked" under your listing, or Chrome shows a red "Deceptive site ahead" warning.

  • Visitors get redirected to another site, often only on their phones or only when they arrive from Google.

  • A site:yourbusiness.com search on Google shows pages you didn't create, often in another language or selling pills, knockoff goods, or gambling.

  • Admin users you don't recognize appear under Users in WordPress.

  • Your host emails you about malware or unusual traffic, or suspends the account.

  • Your site starts sending spam, or your email lands in spam when it didn't before.

  • You can't log in, and the password reset doesn't arrive.

The First Hour, Step by Step

1. Don't delete anything yet

Deleting suspicious files feels like progress, but it destroys the evidence you need to find out how they got in. Without that, the same hole lets them right back in next week.

2. Back up the hacked site

Download a full copy of the site's files and database as they are now, through your host's control panel or a backup plugin. Label it clearly as hacked, and don't restore from it later. This copy is for investigation only.

Then check what clean backups you have, and note the newest one from before the problems started.

3. Change your passwords, starting with email

Change passwords in this order, and use a new, unique password for each one:

  1. The email account tied to your hosting and WordPress admin. Whoever controls that email can reset everything else.

  2. Your hosting account and any FTP or SFTP accounts.

  3. Every WordPress administrator account.

  4. The database password. Your host or developer updates this in wp-config.php at the same time, or the site goes down.

Turn on two-factor authentication wherever it's offered while you're there.

4. Look for admin users you didn't create

In WordPress, go to Users and filter by Administrator. Delete any account you don't recognize. Attackers often add a backup admin so they can get back in after you change your password.

5. Take the site offline if it's hurting visitors

If the site is redirecting people to scams or serving malware, put up a maintenance page or ask your host to take it offline temporarily. A few hours offline is better than customers getting infected, and better than Google flagging you for longer.

6. Figure out how they got in

The most common causes, roughly in order:

  • An outdated plugin or theme with a known security hole. Check Dashboard → Updates.

  • A plugin or theme nobody maintains anymore, even if it's deactivated.

  • A reused or weak admin password.

  • "Nulled" (pirated) premium plugins, which often ship with a backdoor built in.

  • An outdated server, like an old PHP version. This is the kind of thing that happened with the PHP2Shell flaws in October.

7. Restore a clean backup, or clean the site

If you have a clean backup from before the hack, restoring it is usually the fastest and most reliable fix. Then immediately update WordPress, every plugin, and every theme, or you'll be restoring the same hole.

If you don't have a clean backup, the site has to be cleaned by hand. That means replacing WordPress core files with fresh copies, reinstalling plugins and themes from their official sources, and searching the database and uploads folder for injected code. This is detailed work. If you're not comfortable in the file system and the database, it's the point to bring in help.

Clearing Google's "This Site May Be Hacked" Warning

Once the site is clean:

  1. Open Google Search Console and go to Security & Manual Actions → Security issues. Google lists what it found there, with example URLs. Google treats this report as the record of whether the problem still exists.

  2. Make sure every example URL is fixed. If Google still finds a problem, the review fails, and repeat failures can slow down your next request.

  3. Click Request Review and explain briefly what you fixed. For example: "Removed injected spam pages, updated an outdated plugin, changed all passwords."

Google's guide to requesting a review explains what to include. Reviews of sites hacked with spam can take several weeks, so don't resubmit while one is pending. If you never set up Search Console, verify the site now. Google can't send you these alerts otherwise.

How to Keep It From Happening Again

Most WordPress hacks don't come from WordPress itself. Security firm Patchstack counted 11,334 new WordPress vulnerabilities in 2025. 91% were in plugins and 9% in themes, while WordPress core had just six, all low priority. And 46% had no fix from the developer by the time they were made public. That shapes the prevention list:

  • Keep plugins and themes updated, and remove the ones you don't use. Deactivated plugins can still be attacked.

  • Use fewer plugins. Every plugin is someone else's code running on your site.

  • Never install pirated premium plugins.

  • Use unique passwords and two-factor authentication for every admin account.

  • Keep automatic, off-site backups, and test a restore at least once.

  • Run current PHP on hosting that patches the server for you.

  • Set up Google Search Console so you hear about problems from Google, not your customers.

Our free website check flags a few related warning signs in seconds, like a server that advertises its software versions or a missing security header.

When to Call for Help

Do it yourself if you have a recent clean backup and you're comfortable updating plugins. Call for help if:

  • You don't have a clean backup.

  • The hack keeps coming back after you clean it.

  • Customer data, payment pages, or email accounts may be involved.

  • Google has flagged the site and you need the warning gone quickly.

I clean up hacked WordPress sites wherever they're hosted. Send me the address and what you're seeing, and I'll reply within one business day. On our WordPress hosting, WordPress core and plugins are kept under version control. Every change is tracked and can be rolled back, and plugins are installed through me so nothing unvetted goes on the site.

Get help with a hacked site →

Comments

Sign in to leave a comment.