WordPress Malware Removal: A Step-by-Step Guide to Cleaning an Infected Site
WordPress malware removal is one of those tasks nobody plans for until a site starts redirecting visitors to spam pages or Google shows a security warning. The good news is that most infections can be cleaned with a calm, methodical approach.
This guide walks you through spotting an infection, cleaning it safely, and closing the gap that let it in, so you don’t end up cleaning the same site again next month.
Signs You Need WordPress Malware Removal
Malware doesn’t always announce itself. Watch for these common warning signs:
- Visitors are redirected to unfamiliar or spammy websites
- Browser or search engine warnings say your site may be unsafe
- New admin users appear that you didn’t create
- Unknown files show up in your hosting file manager
- Your site suddenly becomes slow or your hosting provider suspends it
- Strange pages or links appear in search results for your domain
If you notice any of these, treat it as urgent. The longer malware stays, the more damage it can do to your visitors, your reputation, and your search rankings.
Before You Start: Protect Yourself First
Rushing into cleanup can make things worse. Take these precautions first:
- Contact your host. Many hosts can confirm an infection, scan the server, or restore a clean backup.
- Make a backup of the current state. Even an infected backup helps if something goes wrong during cleanup.
- Scan your own computer. If your device is compromised, changing passwords won’t help.
WordPress.org also maintains a helpful FAQ for hacked sites that’s worth reading alongside this guide.
7 Steps for WordPress Malware Removal
1. Put the Site in Maintenance Mode
Taking the site offline temporarily protects visitors and stops the infection from spreading further while you work.
2. Change Every Password
Change passwords for WordPress admin accounts, your hosting panel, FTP/SFTP, the database, and any email accounts tied to the site. Use strong, unique passwords for each.
3. Scan the Site to Locate the Infection
Run a malware scan using a reputable security plugin or your host’s scanner. A scan helps identify infected files, suspicious code, and unexpected changes, which makes WordPress malware removal much more precise.
4. Restore a Clean Backup (If You Have One)
If you have a recent backup from before the infection, restoring it is usually the fastest fix. Make sure the backup itself is clean, and keep in mind that restoring doesn’t fix the vulnerability that allowed the attack. A proper backup of your files and database makes this step far easier.
5. Clean Infected Files Manually
If no clean backup exists, manual cleanup is the next option:
- Reinstall WordPress core files from a fresh copy
- Reinstall plugins and themes from trusted sources
- Remove unfamiliar files, especially in
wp-content/uploads - Check
wp-config.phpand.htaccessfor suspicious code - Delete unknown admin users and review all user roles
Manual WordPress malware removal takes care and patience. If you’re not comfortable editing core files, it’s safer to get help.
6. Update Everything
Update WordPress core, plugins, and themes to their latest versions. Delete anything you no longer use, since outdated or abandoned code is a common way attackers get in.
7. Rescan and Test
Run another scan to confirm the site is clean, then test key pages, forms, and checkout processes (if you run WooCommerce) before bringing the site back online.
After WordPress Malware Removal: What to Do Next
Cleaning the site is only half the job. Once it’s clean:
- Request a review if Google or your host flagged the site as unsafe
- Check Google Search Console for security issues or spam pages
- Review user accounts one more time
- Monitor the site closely for the next few weeks in case anything returns
Reinfection usually means the original entry point wasn’t fully closed, so keep watching.
How to Stop Malware From Coming Back
Prevention costs far less than recovery. Build these habits into your routine:
- Keep WordPress, themes, and plugins updated
- Use strong passwords and two-factor authentication
- Install a trusted security plugin with a firewall and malware scanning
- Limit login attempts to slow down brute force attacks
- Schedule regular, tested backups stored off-server
- Avoid nulled (pirated) themes and plugins, which often contain hidden malware
- Remove unused plugins, themes, and user accounts
Regular maintenance makes future WordPress malware removal far less likely to be needed in the first place.
When to Get Professional Help With WordPress Malware Removal
Some infections are stubborn. Backdoors, hidden admin accounts, and database injections can bring malware back even after a cleanup that looks complete.
Consider getting help if:
- The malware keeps returning after cleanup
- Your site handles customer data or payments
- You can’t find the source of the infection
- Your site is blacklisted and you need it cleaned quickly
If you’d rather not risk it, professional WordPress security and malware cleanup services can handle the cleanup, find the entry point, and harden your site against future attacks.
Conclusion
WordPress malware removal doesn’t have to be overwhelming. Stay calm, secure your accounts, scan carefully, clean or restore the site, and update everything before going live again.
Most importantly, don’t stop at cleanup. Fixing the weakness that let the malware in, and keeping up with regular maintenance, is what keeps your site safe for the long run.



