My WordPress is Hacked: What Do I Do Now?
If your WordPress is hacked, first back up the infected site, then change all passwords (WordPress, FTP, hosting and database), scan for malware and remove the infected files. Update everything and set up security and backup so it does not happen again. The steps are below. If you want a quick status first, you can run the free check at /hacket.
Your site can almost always be saved. The important thing is to work systematically.
Signs that your WordPress is hacked
Not sure whether you are hacked? Here are the most common symptoms:
Obvious signs
- The site sends visitors on to other websites (often casino, adult content or phishing)
- Google warns visitors in the search results or in Search Console
- Your hosting shuts the site down
- New users with admin rights that you did not create
- Strange content or links you did not add
Hidden signs
- A sudden, very slow site
- Mysterious files in FTP, often with random names
- Unknown plugins installed
- Changes to
.htaccess - Spam emails sent from your server
Step by step: How to clean your hacked WordPress
1. Back up the hacked site first
Save files and database, even the infected version. You will need it to work out how the attack happened. If you like, put the site behind a maintenance page while you work.
2. Change all passwords
Right away: WordPress admin, FTP/SFTP, the hosting control panel and the database. Use long, unique passwords. Also update the security keys (salts) in wp-config.php so existing login sessions become invalid.
3. Check users
Delete administrators you do not recognize, and look for accounts with elevated rights.
4. Scan for malware
Use a security plugin to scan files and database, for example Patchstack or Wordfence. It finds most known types, but not everything.
5. Remove infected files
Delete unknown files and plugins you do not use. Replace WordPress core, themes and plugins with fresh copies from the official sources. Do not leave wp-content/uploads unchecked: it should only hold media, not PHP files.
6. Check the database
Look for suspicious scripts, especially in the options and posts tables, and for unknown scheduled tasks (cron).
7. Update everything
WordPress, all plugins and all themes. Delete what you do not use. If a plugin has been abandoned by its developer, replace it.
8. Secure the site
A firewall and vulnerability monitoring, two-factor login for all administrators and backup outside the server.
The most common ways WordPress gets hacked
1. Vulnerable plugins and themes
Patchstack's report State of WordPress Security in 2026 counts 11,334 new vulnerabilities in the WordPress ecosystem in 2025. Plugins accounted for 91%, themes for 9%, and WordPress core itself for 6 vulnerabilities (source: patchstack.com, read 22/11-2026). The report also says that about 46% of the vulnerabilities had no fix from the developer when they were disclosed.
Solution: Keep all plugins updated. Delete those you do not use, and avoid plugins that are no longer maintained. See the best security plugins.
2. Weak passwords
"admin" as the username and "password123" as the password can be broken in seconds.
Solution: Strong passwords and two-factor login.
3. Insecure hosting
Cheap shared hosting without isolation between sites can let an infected site spread to others.
Solution: Hosting with isolation between sites. See the hosting guide.
4. Pirated themes and plugins
Illegal copies of paid themes and plugins ("nulled") often contain hidden code.
Solution: Use official sources only.
5. No security measures
No firewall, no scanning, no monitoring.
Solution: Basic security setup, see below and WordPress security.
How to prevent future hacks
Must be in place
- Updates. Keep WordPress, plugins and themes updated
- Strong passwords. Long and unique, in a password manager
- Two-factor login. On all admin accounts
- Security plugin. Patchstack (virtual patching) or Wordfence. See the overview of the best security plugins
- Backup. Automatic backups outside the server. My WordPress backup guide shows how
- HTTPS. Free certificates are available at most hosts
Good extra layers
- Limit login attempts
- Disable file editing in the WordPress admin
- Web Application Firewall (WAF)
- Security headers
- Regular security scans
What does it cost to clean a hacked site?
Do it yourself
- Time: depends on how thoroughly the attack hit
- Risk: You can overlook something and get hacked again
- Price: Free, apart from your time
Professional clean-up
- Time: depends on the scope
- Result: Cleaning and securing
- Price: See my prices or contact me for a quote based on the scope
Service agreement with prevention
- Ongoing monitoring and updates
- Fast response if something happens
- See maintenance and WordPress support
When should you seek professional help?
Contact a professional if:
- You do not know how to do things safely
- The hack comes back after your clean-up
- Your site spreads malware to visitors
- Google has flagged your site as unsafe
- You lose money every day the site is down
- You have a webshop with customer data
Checklist: After clean-up
- ☐ All passwords are changed, and the salts in
wp-config.phpare updated - ☐ WordPress core is reinstalled from the official source
- ☐ All plugins are updated or deleted
- ☐ The theme is updated or replaced
- ☐ The database is checked for malware
- ☐ Unknown administrators are deleted
- ☐ A security plugin is installed
- ☐ Two-factor login is enabled
- ☐ A backup system is in place
- ☐ Google Search Console is checked, and a review is requested if Google flagged the site
- ☐ The host is informed if they shut the site down
FAQ
Can I just restore an old backup?
Maybe. But if the hack happened long ago, the backup may be infected too. And you also restore the security hole that allowed the hack, so update right afterwards.
Should I switch hosting?
Not necessarily, but consider it if:
- Your current hosting is cheap shared hosting without isolation
- You have been hacked several times
- The hosting does not offer basic security features
How long does a clean-up take?
It depends on how many files and how much of the database is affected, and whether you have a clean backup to compare with. A simple infection goes faster than one where the attacker has planted several backdoors.
Can hackers see my customers' data?
Potentially yes. If you have a webshop, you should:
- Check whether customer data has been compromised
- Inform affected customers
- Consider a report to the data protection authority. Under the GDPR it has to happen within 72 hours if the breach may pose a risk to the people concerned (source: GDPR article 33, read 22/11-2026)
How do I know the site is completely clean?
Scan with several tools, check manually for suspicious files and new administrators, and monitor the site in the following weeks for signs that the attack is coming back.
Conclusion
A hacked WordPress site is stressful, but it can be solved. The important thing is to:
- Act fast. The longer you wait, the worse it gets
- Clean thoroughly. Half the work means the site gets hacked again
- Prevent. Find out how they got in, and close the hole
