Malware was found on my site: what now
You may have received an email or seen a warning that malware was found on your site. This article covers the first steps. If your site is defaced, redirecting visitors, or sending spam, go straight to Recover a hacked website.
Stay calm: what an alert means
An alert means the scanner found a file that matches a known threat. It does not always mean your whole site is taken over. Often the problem is one old plugin or a single injected file.
A typical alert lists the account, the file paths, and the threat name, for example:
/home/nsbakery/public_html/wp-content/uploads/2024/03/cache.php
Threat: SMW-INJ-05-php.base64.inject
Status: Infected
| Part | Meaning |
|---|---|
| Path | The file affected. uploads should hold images, not .php scripts, so this one is suspicious |
| Threat name | The scanner's label for what it matched |
| Status | What the scanner did. See Imunify360 |
First hour
- Don't delete anything yet. We need the files as they are to see what happened.
- Read the full list. Open Account → Hosting → your site → Security → Firewall and malware → Malware scanner. What the scanner found lists every file. Click Ask us to clean it next to each one, and we clean it for you. See Imunify360.
- Check your site. Load the home page, a few inner pages, and your login. Also test from your phone's mobile network. Some malware only shows to visitors from search engines.
- Change passwords. Your Barbrick account, WordPress admin, FTP, and the email accounts on the domain. Do this from a computer you trust. See Passwords and password managers.
- Update everything. WordPress core, plugins, themes. Remove ones you don't use. See Keep WordPress, themes, and plugins updated.
- Look for users you don't know. In WordPress, open Users and check for administrators you didn't create. Remove them.
- Scan again. Once we've cleaned the files and you've updated everything, click Scan now in the Malware scanner and check the list is clear.
Clean or restore?
| Situation | Better choice |
|---|---|
| One or two files, and the site works after we clean them | Keep the cleaned files. Update, change passwords, scan again |
| Many files, or files keep coming back | Restore a clean backup from before the infection |
| Site is broken after cleaning | Click Ask for the original back, or restore the files from a backup. See Restore files from a backup |
| Unsure when the infection began | Restore the oldest available point you're comfortable with, then redo your recent edits |
Restoring brings back the same vulnerable plugin that let attackers in. Always update after restoring.
Find how it got in
Malware usually arrives through one of these.
- An out-of-date plugin or theme
- A nulled (pirated) theme or plugin
- A stolen or weak password
- An FTP account on a computer with a virus
Fix the cause or the malware returns.
When to ask us
Open a support request if any of these apply.
- Cleanup failed, or files return after cleaning
- You can't tell whether a flagged file is real
- Visitors are redirected or search results show spam
- You'd like us to check for backdoors
See What to include when you ask for help. Include the file paths from the alert.
If something goes wrong
- The site is blank after cleanup. A core file may have been caught. Restore that file from backup, or ask us to.
- You're locked out of WordPress. See Can't reach wp-admin.
Still stuck? Ask us and we'll walk you through it.
