Skip to content
Daleel Web

WordPress

My WordPress site was hacked: what to do, step by step

Think your WordPress site was hacked? Stay calm, document, scan, reset all access, restore a clean backup and secure the site. A step-by-step checklist.

By Daleel Web Editorial TeamPublished 2 min read
A warning sign over a website window

A hack is stressful, but it is recoverable. The WordPress documentation puts it plainly: yes, you might lose some money and take a hit to your brand, and yes, you will recover (WordPress documentation). Work through the steps below in order.

Signs your site may be hacked

  • Search engines such as Google or Bing blacklist the site.
  • Your host has disabled your website.
  • The site is flagged for distributing malware, or visitors' antivirus flags it.
  • You are told your site is being used to attack other sites.
  • Unauthorized behavior, such as new users you did not create.
  • The site visibly looks hacked in the browser.

Step by step

  1. Stay calm. You will think more clearly and recover faster.
  2. Document. Write down what you see, when you noticed it (with timezone) and what you changed recently, such as a new plugin or theme edit. Note your host environment too. This becomes your incident report.
  3. Scan your website. Use both an application-level scanner (plugins such as Quttera, GOTMLS, Wordfence or Sucuri) and a remote scanner (VirusTotal or Sucuri SiteCheck). Together they improve your odds of finding the problem.
  4. Scan your own computer. Attacks often start locally, where malware can capture FTP and wp-admin logins. Run a full antivirus scan, and try a second product, since some malware hides from antivirus software.
  5. Talk to your host. The hack may affect more than your site, especially on shared hosting, and your host can confirm whether it is a real hack. If your site sent spam, your server's IP may be on email blacklists.
  6. Check blacklists. Register with webmaster consoles such as Google Search Console and Bing Webmaster Tools to see warnings.
  7. Reset all access. Use long, unique passwords and change every access point: FTP/SFTP, wp-admin, your hosting panel and the database, for all users. Consider two-step authentication. Force a password reset for everyone, especially administrators.
  8. Log everyone out. Generate new secret keys and replace the values in wp-config.php so anyone still logged in is signed out.
  9. Make a backup. If you do not have one, create one now. If you have a clean one, you can restore it and move on to finding the cause.
  10. Find out how they got in. This forensic step is difficult without technical knowledge or logs. If you cannot do it yourself, ask a professional.
  11. Secure the site. Apply the recommended hardening measures so the same hole is not used again. See our security basics and login protection guide.

If you are locked out

Reset your password through the standard process. If you cannot, your host may offer phpMyAdmin or Adminer, which let you edit the user in the wp_users table directly. Or change the user's email there and use the forgot-password link.

Prevent the next one

Keep tested backups (backup guide), keep everything updated and use strong logins.

Checklist

  • Symptoms and times written down
  • Site and own computer scanned
  • Host contacted
  • All passwords changed, secret keys replaced
  • Clean backup restored or created
  • Hardening applied

Frequently asked questions

How do I know my site was hacked?

The WordPress documentation lists clear signs: the site is blacklisted by search engines, your host disabled it, it is flagged for distributing malware, visitors report antivirus warnings, you are told it is attacking other sites, you see unauthorized behavior such as new users, or the hack is visible in the browser.

Is changing my password enough?

No. The documentation says passwords are one small piece. Change all access points: FTP/SFTP, wp-admin, your hosting panel and the database, for all users.

I cannot log in to my admin panel. What now?

The documentation suggests resetting your password, or using a database tool such as phpMyAdmin or Adminer from your host to change the user in the users table. Updating the user's email and using the forgot-password link also works.

Sources & references

  1. WordPress.org Documentation: FAQ My site was hacked