Step-by-step guide
Website malware removal: find it and get rid of it
If your site redirects visitors, shows spam or got flagged by Google, it probably has malware. Here is how to confirm it, clean it safely and, most important, stop it coming back.
By the Bug Circuit security team · Last updated
Signs your website has malware
- Visitors are redirected to spam, casino or pharmacy sites, often only when they arrive from Google or on a phone.
- Google or your browser warns people: “This site may be hacked”, “Deceptive site ahead” or a Search Console Security Issues message. See the “may be hacked” warning and the “Deceptive site ahead” warning.
- Search results show strange pages or Japanese, Chinese or pharmacy text under your domain, as in the Japanese keyword hack.
- Your host suspends the site or your email starts landing in spam folders.
- Admin users you did not create, files changed at odd hours, or a sudden jump in server load.
Not sure yet? The free website security check and the is my website hackable guide show what is exposed from the outside.
Where website malware hides
Most infections use a handful of places. Check each one.
| Where | What to look for |
|---|---|
| Core, plugin and theme files | Files that differ from the official copy, or extra PHP files next to them. |
| Upload folders | Any .php file in wp-content/uploads or a similar folder. Uploads should hold images and documents only. |
| .htaccess and config files | Rewrite rules that send search visitors to another domain, or code added at the top of wp-config.php or index.php. |
| The database | Script or iframe code inside posts, widgets and options that you did not add. Unknown admin users. |
| Scheduled tasks | Cron jobs or scheduled actions that re-download the malware after you delete it. |
| Fake plugins and mu-plugins | Plugins with random names, or files in the must-use folder you did not put there. |
Step by step: how to remove it
1. Contain it
If visitors are being redirected or served malware, turn on maintenance mode or take the site offline and tell your host. Keeping an infected page live harms your visitors and your search ranking.
2. Back up the infected site
Copy the files and the database exactly as they are. You want this evidence, and it lets you undo a cleanup mistake. Keep your last known-clean backup separate and untouched.
3. Find what is infected
On WordPress, WP-CLI can compare your files with the official copies and list admin users:
wp core verify-checksumsandwp plugin verify-checksums --allreport files that differ.wp user list --role=administratorshows admin accounts. Remove any you do not recognise.find wp-content/uploads -name "*.php"lists PHP files in the uploads folder, which should not exist.find . -name "*.php" -mtime -14lists PHP files changed in the last 14 days.wp db search '<iframe' --all-tablesfinds injected iframes in the database. Search for<scripttoo.
On other platforms the idea is the same: compare with a clean copy, look at recently changed files, and look for code you did not write. Be careful with search patterns such as eval(base64_decode: some legitimate plugins use them, so check each hit before you delete it.
4. Clean it or restore a clean backup
The safest cleanup is to replace, not edit: reinstall WordPress core with wp core download --force --skip-content, reinstall plugins and themes from their official source, and delete files you cannot account for. If you have a backup from before the infection, restoring it is faster. Either way, the next steps are not optional.
5. Update everything and rotate every secret
Update the CMS, plugins and themes, and delete anything abandoned or “nulled” (pirated). Then change the hosting panel, FTP or SFTP, database, admin and API credentials, and generate new WordPress security keys. Assume any password that was on the server is known.
6. Find and close the entry point
Malware is the symptom. The cause is usually an outdated plugin, a weak or stolen password, or an unsafe upload form. Look at your access logs for the first strange request, and check what changed around that date. This is the step that decides whether the site is clean for good. A manual security audit is built for exactly this: a person looks for the weaknesses an attacker could use.
7. Clear warnings and keep watching
If Google flagged the site, open the Security Issues report in Search Console and request a review once it is clean. Then watch it: scan weekly, check for new files and admin users, and turn on alerts for file changes.
Do it yourself, use a plugin, or hire someone?
| Do it yourself | Scanner plugin | A professional | |
|---|---|---|---|
| Best for | A simple infection and a technical owner | Finding modified files quickly | Shops, client sites and repeat infections |
| Main risk | A missed backdoor | Deleting what it flags without finding the cause | Paying for a cleanup that skips the root cause |
| Finds the entry point? | Only if you look for it | Rarely | Ask before you hire: it should be included |
| Time | Hours to days | Minutes to scan, then you still clean | Usually hours to a few days |
For typical prices, see what it costs to fix a hacked website. If your site is on WordPress and keeps getting reinfected, read why a WordPress site keeps getting hacked.
How Bug Circuit helps
- Circuit, $49 one-time: a security expert audits your site by hand and writes a report of every weakness with the exact fix, so you can close the hole the attacker used.
- Signal, $147 every 3 months: everything in Circuit, plus we fix the high and critical issues with you, re-test, run weekly checks and include one hack cleanup a year.
- Free check: run the passive scan first to see what is exposed. Nothing touches your site.
See pricing for the details. There is a 14-day money-back guarantee if testing has not started.
Frequently asked questions
How do I remove malware from my website manually?
Can I remove website malware for free?
How do I know the malware is really gone?
Should I restore from a backup or clean the files?
Why does the malware keep coming back?
Will removing the malware remove the Google warning?
How long does malware removal take?
Keep reading
Find out how they got in
Run the free passive check on your domain. No login, no card, nothing touches your site.
Ready for the full manual audit? See pricing