100% Free · Open Source GPLv2 · Zero setup requiredGet the Plugin

Opens in a new tab
ITX UserOps
Free

PHP in uploads

One switch that makes a backdoor dropped into wp-content/uploads inert — without deleting anything or breaking the plugins that keep PHP there.

ITX UserOps → Settings → PHP in uploads. Free since 2.5.0, and off until you switch it on.

Why

The uploads folder is the one place on a WordPress site that visitors' actions write files into, which makes it the favourite place to drop a backdoor. The attacker then opens it by its address — /wp-content/uploads/2026/10/x.php — and it runs.

Nothing a site uploads needs to run that way. Plugins that do keep PHP in uploads — WPML's template cache, a theme's saved settings — load it from inside WordPress, which a web-server rule does not touch. So refusing to run PHP there by URL makes a dropped file inert without breaking anything that legitimately keeps one.

Files are not removed. They simply cannot be run by visiting them.

What it does on your server

ServerWhat happens
Apache, LiteSpeedThe rule is written to wp-content/uploads/.htaccess, between # BEGIN ITX UserOps and # END ITX UserOps markers, leaving anything else in the file alone
nginxnginx reads no .htaccess file. The screen shows the rule to give your host; nothing is enforced until they add it
IIS and othersNot supported. Ask your host to refuse PHP in wp-content/uploads

The rule matches a PHP extension anywhere in the name, not only at the end — x.php.jpg runs as PHP on an Apache server configured a certain way, and that is exactly the misconfiguration an upload backdoor is written for.

For nginx, the screen gives a block like this, with your uploads path filled in:

location ~* ^/wp-content/uploads/.*.(php[0-9]?|phtml|phar|pht|phps)(.|$) {
	deny all;
}

Proved, not assumed

A server can be set to ignore .htaccess files entirely and say nothing about it. So after writing the rule, the plugin places a harmless test file in uploads and requests it over HTTP:

  • Refused — the rule is working
  • It still ran — the rule is written, but this server ignores it, usually because of AllowOverride None. Ask your host to allow .htaccess in uploads, or to add the rule themselves
  • Could not be checked — the site could not request its own test file. That usually means requests to itself are blocked, and says nothing either way about the rule

Check again repeats the test at any time.

Switching it off, and uninstalling

Switching it off removes the plugin's block from uploads/.htaccess and nothing else.

Deactivating the plugin leaves the rule in place, and so does uninstalling it — unless Delete all plugin data on uninstall is on, in which case the block is removed with everything else. A rule left behind keeps protecting the site and needs nothing from the plugin to work; to remove it, switch it off here before uninstalling, or delete the marked block from the file.

  • Signs of a break-in reports a file in uploads that starts WordPress, which this rule would have refused
  • With premium, the security level checks for PHP files already sitting in uploads, and they can be quarantined from File changes

Log in

Vote on ideas, submit your own and join the discussion.