My WordPress site was hacked: the first hour

Short answer: lock the doors first (passwords and admin users), keep a copy of the site as it is, then clean or restore it. Acting fast limits the damage to your customers and your Google rankings.

Signs your site has been hacked

  • Visitors are redirected to spam, gambling or pharmacy sites (sometimes only on mobile, or only from Google)
  • Google or your browser shows a “deceptive site” or malware warning
  • Admin users you don’t recognise, or you can’t log in
  • Strange pages or links appear in Google search results for your site
  • Your host has suspended the account or emailed about malware or spam being sent
  • Your site suddenly becomes very slow, or your server usage jumps

Minutes 0–15: lock the doors

  1. Change your WordPress password and those of every admin user. Use long, unique passwords.
  2. Check Users → All Users. Remove any administrator you don’t recognise.
  3. Change your hosting (cPanel) and FTP passwords, and your database password if you know how. Hackers often leave themselves more than one way back in.
  4. Change the password on the email account linked to your admin user. If attackers control that inbox, they can reset everything else.

Minutes 15–30: keep evidence, don’t panic-delete

  • Take a backup of the site as it is now, hacked or not. If a clean-up goes wrong, you need something to fall back on, and it helps a professional see what happened.
  • Don’t delete files at random. Removing the wrong file can take the site down completely while leaving the actual backdoor in place.
  • Tell your host. Many hosts can confirm what was changed and when, and some include malware scanning.

Minutes 30–60: find out how bad it is

  • Run a security scan with a reputable security plugin or an external scanner to see which files are infected.
  • Check Google Search Console for a “Security issues” report. If Google has flagged your site, you’ll need to request a review after cleaning.
  • Look at when files changed. Many hacks inject code into theme files, wp-config.php or fake plugin folders.

Clean it, or restore it?

OptionWhen it worksWatch out for
Restore a clean backupYou have a backup from before the hack, and you know roughly when it happenedAnything added since that backup is lost, and the hole they used is still open until you update
Clean the infected siteNo clean backup, or the hack is recent and limitedMissed backdoors mean reinfection, often within days

Either way, update WordPress, all plugins and your theme straight after, and remove plugins and themes you don’t use. Outdated software is the usual way in.

After the clean-up

  • Ask Google to review your site if it was flagged.
  • Watch for reinfection over the next two weeks.
  • Turn on two-factor authentication for admin logins.
  • Put regular updates and off-site backups in place so you’re never in this position without a way back.

Need it handled now? Report a hacked site and choose “Losing business now.” Hacks go to the front of our queue. Don’t send passwords in the form: we’ll ask for access securely once you approve the quote.

Not sure how healthy your site is?

Get a free WordPress health check. We check your site from the outside and email you a plain-English report within one working day. No logins, no obligation.

← All guides