Initial assessment without passwords Quote before intervention One accountable specialist from start to finish

Malware & Security

Malicious PHP Files in wp-content/uploads: Containment and Root-Cause Checks

PHP inside uploads is a strong compromise signal on most sites. Preserve, block execution, identify the uploader and remove persistence.

PHP files inside wp-content/uploads deserve immediate investigation because uploads should normally contain media, not executable application code. The file may be a malicious payload, a dropper left by another compromise or, less commonly, a deliberate custom component stored in the wrong place.

Contain execution before deleting the evidence

Prevent public execution of the suspicious file or directory while preserving a copy, hash, owner and timestamps. Record requests that reached it. Deleting the file first can remove the best clue to the component or account that wrote it.

Trace how PHP reached a writable media directory

  • Look for vulnerable upload handlers and recently changed plugins.
  • Review file ownership and the PHP/web-server account.
  • Correlate creation time with access logs and administrator activity.
  • Search for references to the file from themes, plugins, cron and database options.

One PHP file often points to wider persistence

If the payload is part of a visible fake-update campaign, compare theme-level malware such as WP-VCD. If the compromise also changes core or root files, use file-integrity triage to scope the wider change set.

Recover the write path, not only the uploads folder

  1. Remove confirmed malicious files after evidence capture.
  2. Patch or replace the component that allowed the write.
  3. Reinstall affected application code from trusted sources.
  4. Rotate credentials that could upload or modify code.
  5. Block PHP execution in media directories where compatible with the application.

Do not chmod the whole site read-only as a permanent answer

WordPress still needs controlled writable areas. The goal is least privilege: only the expected process should write to the expected paths.

Verification

No executable files should reappear in uploads through normal traffic, scheduled tasks or restarts, and legitimate media uploads must continue to work without restoring excessive permissions.

WP REPAIR INCIDENT STANDARD

Safe intervention sequence

Deleting one shell does not reveal how it arrived or whether another loader can recreate it. Timestamps, ownership, access logs and related files connect the payload to an entry point.

WP RepairDiagnostic model
1Trigger2Payload3Persistence4Entry point
Follow the chain until you find the first point that stops behaving as expected.
  1. List every executable extension and suspicious double extension under uploads.
  2. Record hashes, timestamps, owner and paths before quarantine.
  3. Match creation times with access, plugin upload and authentication logs.
  4. Search for references to the files in cron, options, themes, plugins and server rules.

What must be verified

  • No executable files remain in writable media directories.
  • The server refuses execution attempts under uploads.
  • Monitoring shows no recreation and the original write path is closed.

ABOUT THIS SYMPTOM

Frequently asked questions about this guide.

Is it enough to just delete the malicious PHP file once I find it in uploads?+

No. Deleting the file removes the immediate payload but does not reveal how it got there or whether a separate loader can simply recreate it. Timestamps, ownership, access logs, and related files need to be traced back to the actual entry point before the incident can be considered closed.

Should I open the suspicious PHP file in a browser to see what it does?+

No, this is explicitly unsafe. A web shell can execute attacker logic the moment it is requested, so it should be analyzed as a preserved offline copy rather than triggered live, on the assumption that any request to it could run malicious code.

Why does malware keep appearing in wp-content/uploads specifically, rather than in plugin or theme folders?+

The uploads directory is normally meant only for media, but it is writable by WordPress and frequently survives full plugin or core replacement, which makes it an attractive target for attackers wanting a payload that persists through cleanup.

If only one site is affected, should other sites on the same server be checked too?+

Yes. When multiple sites share the same hosting account or system user, a vulnerable upload endpoint or stolen credentials on one site can be used to write files into others, so neighbouring sites and accounts sharing that system user should be scanned as well.

BEFORE YOU SEND THE REQUEST

Frequently asked questions.

Do you ask for passwords in the form?+

No. The public form never requests access. Secure credentials are requested only after the scope and quote are approved.

Who reviews the incident?+

The request goes to Jordi Ensenyat, founder of Code Barcelona and a WordPress specialist with more than 15 years of experience.

Is anything changed before the quote?+

No. Visible symptoms and scope are reviewed first. Intervention begins after approval and with a rollback path prepared.

Do you work internationally?+

Yes. WP Repair handles WordPress and WooCommerce incidents in English and Spanish through a remote service.

Assess my incident↗