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.

On this page
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
- Stay calm. You will think more clearly and recover faster.
- 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.
- 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.
- 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.
- 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.
- Check blacklists. Register with webmaster consoles such as Google Search Console and Bing Webmaster Tools to see warnings.
- 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.
- Log everyone out. Generate new secret keys and replace the values in
wp-config.phpso anyone still logged in is signed out. - 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.
- 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.
- 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
Related reading
WordPress
WordPress security basics: the habits that stop most attacks
Security is risk reduction, not perfection. Learn the core WordPress habits: updates, strong passwords with two-step login, trusted plugins and backups.
2 min read
WordPress
WordPress backups: what to back up, how often and where to keep it
A WordPress site has two parts to back up: files and database. Learn how often to back up, where to store copies and how to restore safely.
2 min read
WordPress
How to protect your WordPress login from brute force attacks
Bots try passwords on your WordPress login all day. Learn the defenses that matter: strong passwords, 2FA, rate limiting, CAPTCHA and XML-RPC.
2 min read