WordPress malware removal involves removing malicious code, securing compromised accounts and closing the security weakness that allowed the attacker in. Simply deleting an infected file won't stop the problem from returning.
At Everge, we design and build WordPress websites ourselves, as one team based in Leicestershire, and we judge a website on the enquiries it brings in. If your existing website has become difficult to secure and you're considering a rebuild, tell us about your project.
This guide explains how to clean a hacked website, check whether a backup is safe to restore, uncover hidden infections and recognise when it's time to stop paying for repairs.
WordPress Malware Removal: The Short Answer
Think of a hacked website like a burgled office. You wouldn't tidy up the mess and leave the broken lock on the front door.
A proper clean-up involves investigating website files, databases, user accounts and hosting settings. You need to remove the infection and address its cause before welcoming customers back.
How to Tell if Your WordPress Site Has Been Hacked
Security specialists call these warning signs indicators of compromise (IOCs):
- Visitors are redirected to unfamiliar websites.
- Administrator accounts appear without permission.
- Google displays security warnings.
- Unwanted pages, posts or links appear.
- You're locked out of your WordPress dashboard.
- Your hosting provider suspends your account.
These symptoms don't always confirm an infection, but they deserve investigation.
Why Deleting One Infected File Is Not Enough
A backdoor is a hidden way for an attacker to regain access to your website. It might sit inside a plugin, an uploaded file or an unauthorised administrator account.
Remove the visible malware without addressing the backdoor, and you could find yourself dealing with the same problem next week.
Where outdated software is at the heart of the problem, investing in WordPress web design may make more commercial sense than repeatedly repairing an unreliable website.
Before You Start: Five Mistakes That Make a Hacked Website Worse
When your website stops bringing in enquiries, it's tempting to rush into a repair. Unfortunately, that can make recovery considerably harder.
Restoring a Backup You Haven't Checked
You've got a backup from last Tuesday. Brilliant. But how do you know the website wasn't already infected on Monday?
Restore the backup in an isolated test environment. Scan its files and database, review administrator accounts and scheduled tasks, and compare standard files against trusted copies. Neither the backup's age nor a clean scan proves it's safe.
Read our guide on how to back up your WordPress site for more information.
Reinstalling Your Theme and Hoping for the Best
Replacing an infected theme won't remove malware hiding in your database, plugins or uploads folder. It's rather like repainting a damp wall without fixing the leak.
Deleting Malware Without Investigating the Backdoor
Preserve suspicious files for investigation before removing them. Establish whether another file or scheduled task is recreating the infection.
Changing Only Your WordPress Password
Your hosting account, database, email and file transfer credentials may also be compromised. Changing one password could leave several other doors wide open.
Leaving Your Website Live While It Redirects Customers
Restrict public access immediately if your website sends visitors to scams or malicious downloads. Taking your website offline is frustrating, but exposing customers to harmful content is considerably worse.
How to Remove Malware from WordPress, Step by Step
You don't need to become a security specialist overnight. Understanding these steps will help you know what needs doing and what to expect from a professional clean-up.
Step 1: Back Up the Infected Website
Restrict public access and preserve a complete copy of your website files, database and available server logs. This backup is for investigation, not routine restoration. Store it securely away from your live website and clearly label it as infected.
Step 2: Secure Your Accounts and Replace WordPress Salts
Using a trusted device, reset potentially compromised credentials for WordPress, hosting, SFTP, FTP, databases and associated email accounts. Use encrypted SFTP instead of ordinary FTP where possible.
Replace the security keys and salts in `wp-config.php`. Replacing them logs out everyone still signed in, including an attacker using a stolen login.
Step 3: Replace WordPress Core Files and Verify Checksums
WordPress core files are the standard files that make the platform work. Replace compromised core files with fresh, official copies, and check for additional files, as simply overwriting existing ones may leave malware behind.
Developers can use WP-CLI to check file integrity:
`wp core verify-checksums`
A checksum works like a digital fingerprint, helping identify files that differ from the official release. This check doesn't verify your plugins, themes, database or uploads.
Step 4: Reinstall Clean Plugins and Themes
Replace plugins and themes with trusted copies from their original developers or the official WordPress directory. Remove unused software and replace unsupported components.
A nulled plugin is an unofficial copy of commercial software distributed outside its normal licensing system. It may contain malicious code. That supposedly free plugin could turn out to be an expensive mistake.
Step 5: Inspect the WordPress Uploads Folder
The `wp-content/uploads/` folder normally contains images, documents and other media. Investigate unexpected PHP files, unusual extensions and hidden directories. Attackers sometimes conceal backdoors here.
Step 6: Remove Malware from the WordPress Database
A database injection occurs when unwanted code or content is inserted into database records. Investigate malicious scripts, spam posts, hidden links, altered settings and rogue administrator accounts.
Common tables to check include `wp_posts`, `wp_options`, `wp_users` and `wp_usermeta`. Avoid broad deletion commands that could damage legitimate business data.
Step 7: Investigate Hidden Backdoors and Redirects
Several locations deserve particular attention:
- `.htaccess`: altered rules can redirect visitors.
- `wp-config.php`: configuration files may contain injected code.
- MU-plugins: must-use plugins load automatically outside normal plugin controls.
- Cron jobs: scheduled tasks may recreate deleted malware.
Step 8: Run a Final Scan and Test the Website
Run another malware scan, then put yourself in your customer's shoes. Can you submit an enquiry? Complete a purchase? Receive a confirmation email?
Test your website while logged out, too. Some infections behave differently when administrators visit. Once your checks are done, create a fresh backup before restoring public access.
What Your WordPress Malware Scanner Might Miss
A green tick on your dashboard doesn't necessarily mean your website is clean.
Hidden Backdoors and Rogue Administrators
Scanners may miss unfamiliar malicious code or unauthorised accounts that give attackers access through the normal login screen. Malicious cron jobs and database injections also deserve investigation, particularly when previous clean-ups have failed.
Shared Hosting and Recurring Infections
If several websites share a hosting account without proper isolation, an infection on one could affect another. Ask your hosting provider to investigate the wider account.
Why Your WordPress Site Keeps Getting Hacked
Recurring infections often point to an unresolved vulnerability, hidden backdoor, stolen credentials or unsupported software.
Keep WordPress, plugins and themes updated. Use individual staff accounts, strong passwords, two-factor authentication (2FA) and tested off-site backups. Our guide to Wordfence settings explains additional security measures.
After the Malware Cleanup: Google, Your Host and Your Customers
Removing the infection is only part of getting your business back on its feet.
Removing Google's “This Site May Be Hacked” Warning
Open the Security Issues report in Google Search Console and investigate the reported problems. Once you've addressed them, request a review. Explain what you found, what you've removed and how you've closed the security weakness.
Google's review can take from a few days to a few weeks, so warnings don't disappear the moment the clean-up ends.
Tell Your Host and Check Your Customer Data
Inform your hosting provider and investigate whether personal data was exposed. Document your investigation, even if nothing turns out to need reporting.
When WordPress Malware Removal Stops Being Worth the Money
The clean-up invoice only tells part of the story. What about lost enquiries, interrupted sales, wasted advertising spend and staff time?
Abandoned themes, page-builder add-ons and years of technical workarounds make older websites increasingly difficult to secure.
Should You Clean a Hacked WordPress Site or Rebuild It?
| Consider cleaning when | Consider rebuilding when |
|---|---|
| The infection has an identifiable cause. | Infections repeatedly return despite thorough clean-ups. |
| Plugins and themes receive security updates. | Essential software is abandoned. |
| The underlying code is sound. | The website relies on fragile, outdated code. |
| Security weaknesses can be addressed. | Fixing the weaknesses requires extensive redevelopment. |
A rebuild won't automatically resolve compromised hosting or stolen credentials. Those problems still need addressing.
What to Look for When Paying for Malware Removal
Ask whether the specialist investigates the original entry point, cleans the database, removes backdoors and checks the wider hosting account. Find out how they verify the clean-up and what happens if the infection returns.
Want us to rebuild it properly?
Your website should help you run your business, not give you another job to do.
Our WordPress web design approach starts from a fresh technical foundation, with fewer, carefully selected plugins and custom code where it's needed. We move your content across, set up redirects so you keep your Google rankings, and you own the code.
We're one team based in Leicestershire, designing and building WordPress websites for businesses across the UK. Business websites cost £2,000–£6,000 + VAT, and we agree a fixed price in writing before we start.