WordPress security guide

How to Review WordPress Malware Scan Findings Safely

A scanner finding is a clue, not an instruction to delete a file. Check why it was flagged, where it lives, and what changed before you repair, replace, quarantine, or remove anything.

Start With What the Finding Actually Means

Not every scanner finding means the same thing. A known malware signature, a modified WordPress core file, an unexpected administrator, and suspicious database content all require different checks before you act.

The first question is not “How do I remove this?” It is “What exactly did the scanner detect?”

FindingWhat to ask first
Known malware signatureWhat code or content matched, and is the match inside a legitimate file?
WordPress core integrity mismatchDoes the file differ from the matching official WordPress release?
Modified plugin or theme fileIs the change expected, customized, generated, or present in the trusted package?
Suspicious code patternWhat does the code actually do in this context?
Executable file in an unusual locationWhy is executable code present there, and what created it?
Suspicious database contentWhich plugin, account, or process wrote it?
Unexpected administratorWhen was the account created and by whom?
Domain or IP reputation findingWhat external reputation signal triggered it, and is there related site activity?

“Modified” does not automatically mean malicious. “Suspicious” does not mean safe to ignore. Treat the finding as evidence that needs context.

If the issue is a vulnerable plugin, theme, or WordPress version rather than malware, use the vulnerability response guide.

Using SiteFort: Standard Scan is suitable for routine monitoring. Deep Scan is useful after a confirmed compromise, when symptoms continue, or when the first scan suggests deeper review. See the Scanner docs for scan scope, credits, scheduling, and configuration.

Look at the Location Before the Delete Button

Where a finding lives often tells you as much as the detection itself.

WordPress core

WordPress core files have a known clean source. If a file under wp-admin, wp-includes, or another core location differs unexpectedly, compare it with the matching official WordPress release.

If the change is not legitimate, replacing the file from a clean source is usually safer than manually editing suspicious lines out of core.

Plugins and themes

A changed plugin or theme file needs more context. It might be malware, but it could also be a legitimate customization, generated code, or a vendor change.

Where possible, compare it against the same version from the trusted plugin or theme source before replacing anything.

Uploads

wp-content/uploads/ is normally used for media and other writable content. Executable PHP or similar code in that location deserves immediate review.

A PHP file in uploads is not automatically proof of malware, but it should be treated as high priority until you know exactly what created it and why it needs to execute from a writable directory.

WordPress root and unfamiliar directories

An unfamiliar PHP file with a strange name is suspicious, but the filename alone is not enough reason to delete it.

Check what owns it, when it appeared, whether anything loads it, and whether it belongs to legitimate hosting, deployment, or application tooling.

Verify the Finding Before You Remediate

Before changing the file, gather enough context to understand what you are looking at.

CheckWhy it helps
File pathShows whether the file belongs in that location
Modification timeHelps correlate the change with updates or suspicious activity
File diffShows exactly what changed
Known-good packageGives you a trusted version for comparison or replacement
Access and error logsMay show when the file was accessed, written, or triggered
Nearby findingsCan show that the problem is wider than one file
Account and audit activityMay connect the change to an administrator, plugin action, or other event

One suspicious function name or one unusual line is rarely enough context on its own. Look at what the code does, where it came from, and whether a clean reference exists.

Using SiteFort: open the finding details and review the available file comparison or diff before choosing a remediation action. Exact finding controls are covered in the Scanner documentation.

Preserve Enough Evidence to Find the Cause

Removing the malicious file may restore the site, but it can also erase useful evidence about how the file arrived.

Before replacing or deleting a suspicious item, capture what you reasonably can:

  • full file path
  • file hash
  • modification time
  • finding details and detection reason
  • a quarantine or protected copy where appropriate
  • relevant access, error, audit, or file-change logs

This does not mean delaying containment of an actively malicious file while trying to build a perfect forensic record. Preserve enough context to continue the investigation, then stop the harmful behavior.

Do not expose your evidence. If you keep an infected-site archive or suspicious-file copy, store it somewhere that cannot be downloaded or executed from the public website.

Choose the Safest Remediation

The right action depends on what you know about the file or finding. Deleting everything suspicious is not a cleanup strategy.

SituationSafer response
Unexpectedly modified WordPress core fileReplace it from the matching clean WordPress release
Compromised plugin or theme file with a trusted package availableCompare and replace the affected file or package from clean source
Clearly malicious standalone fileQuarantine first if practical, verify dependencies, then remove it
Suspicious file with an uncertain purposePreserve it and investigate before deleting
Injected database contentRemove the malicious content and investigate what wrote it
Unexpected administrator accountRevoke access and investigate how the account was created
Same malware repeatedly returnsStop deleting the symptom and find the persistence mechanism

Repair: use it when you know what the clean file should contain and can restore it from a trusted source.

Replace: for WordPress core and vendor code, replacing from a trusted package is often safer than manually editing malware out of the file.

Quarantine: useful when you need to stop execution while preserving the file for review, rollback, or evidence.

Delete: appropriate only when you are confident the file is malicious or has no legitimate purpose. If you are not sure what it does, investigate first.

Do not bulk-delete findings. A malicious standalone file, a modified vendor file, and a legitimate customized file can all appear suspicious for very different reasons.

Use Severity as a Triage Aid, Not a Verdict

Severity is useful for sorting a findings list, but it should not replace judgment.

When deciding what needs attention first, consider:

  • Confidence: how certain is the detection?
  • Exposure: can the file or behavior be reached from the internet?
  • Impact: what could the finding allow an attacker to do?
  • Activity: is there evidence that the finding is currently being used?

A confirmed web shell that is directly reachable deserves immediate attention. An unexpected administrator account may also be more important than a technically higher-scored informational file issue.

Use severity to sort the queue, not to decide the incident for you.

If Malware Comes Back, Find What Is Recreating It

If the same file or injection returns after cleanup, repeatedly deleting it is no longer useful. Something else is still writing it back.

Check for persistence in:

  • WordPress cron and server-level scheduled tasks
  • must-use plugins
  • compromised plugins or themes
  • writable upload directories
  • wp-config.php or other bootstrap files
  • database options or injected content
  • unexpected administrator accounts
  • deployment scripts or automated jobs
  • hosting or server processes
  • compromised SFTP, SSH, hosting, or WordPress credentials

Compare the time the malware reappears with file modification logs, web-server logs, audit events, scheduled jobs, and active processes.

If deleting the same file works only temporarily, the file is probably the symptom, not the source.

For a real example, see our case study on a persistent WordPress infection that continued rewriting index.php after the visible malware had been cleaned.

Verify the Cleanup

A clean rescan is useful, but it is not the only test that matters.

After remediation:

  • run the malware scan again
  • check that the original symptom is gone
  • verify repaired core and vendor files against trusted sources
  • review administrator accounts and recent privilege changes
  • check recently modified files for unexpected activity
  • review relevant access, error, firewall, and audit logs
  • patch or remove the vulnerable software involved in the compromise
  • revoke or rotate credentials if account access may have been involved
  • watch for the same file, redirect, spam page, or other symptom returning

A scan that now shows no findings does not automatically prove that the original entry point has been fixed or that persistence outside the scan scope is gone.

A successful cleanup means the malicious behavior has stopped and the path back in has been addressed, not simply that one scan now shows green.

Need the exact SiteFort scanner configuration? Use the Scanner documentation for Standard and Deep Scan behavior, scheduling, exclusions, quarantine retention, scan credits, notifications, and remediation controls.