20%Christmas Sale — Save 20% on All PRO Plugins!

24Days20Hours02Minutes58Seconds
Shop Now
· Security & Monitoring

Unexpected PHP Files in WordPress Uploads: How to Investigate

A website administrator reviews a PHP file among image thumbnails in a media folder.

In a typical WordPress site, wp-content/uploads holds images, PDFs and other media. Some plugins store cache files or exports there, but executable PHP files are rarely needed in that folder. That is why a new .php file in uploads deserves attention – and a calm, ordered response.

1. Do not delete it straight away

First copy the file and note its path, size and modification time. If it turns out to be malicious, these details help you find how it arrived and whether other files appeared at the same moment.

2. Check whether a plugin created it

Look at the folder name. Paths such as uploads/some-plugin-cache/ often belong to a known plugin. Compare with the plugin’s documentation or a fresh installation. A file with a random name inside a year/month media folder is much more suspicious.

3. Look at the timeline

  • Which other files changed around the same time?
  • Were plugins or themes updated, or new users created?
  • Do server access logs show requests to that file?

4. Contain and clean

If the file is not legitimate, put the site in maintenance mode, remove the file, update WordPress, plugins and themes, change administrator and database passwords and review user accounts. If you are not sure how the file got there, involve your host or a security professional.

5. Block PHP execution in uploads

Most hosts allow you to block PHP execution in the uploads folder through server configuration. This does not fix the cause, but it prevents uploaded scripts from running. Test the site afterwards, because a small number of plugins expect otherwise.

6. Watch for the next change

After cleaning, record a new baseline so that the next unexpected file is noticed quickly rather than weeks later.

File Integrity Monitor PRO keeps a SHA-256 baseline, runs scheduled scans of the paths you choose, records new, changed and deleted files with a review workflow and sends alerts. It supports investigation; it does not remove malware or replace a security audit.

Next step: See File Integrity Monitor PRO on Pluginivo or read the File Integrity Monitor PRO documentation. Plugin features support your workflow; results depend on your store, settings and data.

MORE GUIDES

Continue Reading

More practical guides for WordPress and WooCommerce.

PLUGINIVO NEWSLETTER

More WordPress tips. Less guesswork.

Practical WordPress and WooCommerce guides, plus occasional updates about Pluginivo plugins.

← All articles