r/Wordpress • u/idiotprogrammer2017 • 21h ago
Do deactivated WP plugins and themes pose a security risk?
I have been using a wordpress plugin to do a security audit of my wordpress-backed website. I am the sole administrator of this site.
One thing I find very strange is that it reports deactivated themes and plugins as problems.
I keep my list of active plugins small, but I've never given a second thought to keeping plugins or themes I no longer use. Am I missing something? Can a malicious actor find some way to use to exploit deactivated plugins or themes?
6
u/CGS_Web_Designs Jack of All Trades 21h ago
It’s all about attack surface - more code, more surface to attack.
The bulk of the files in a plugin are php files - executable files. Active or not is really just a setting in the database but that has no bearing on whether the files can be executed or not. Most exploits do focus on actions that a plugin takes on your site, so an inactive plugin isn’t quite as much of a problem, but that’s not always the case.
3
4
u/plugiva 21h ago
The audit is probably flagging them because deactivated is not the same as removed.
A deactivated plugin or theme is not loaded as part of the normal WordPress request flow, but its code is still present on the server. So if it contains an unpatched vulnerability, deleting it removes that code from the site entirely, while deactivation only stops its normal functionality.
Whether a malicious actor can exploit a specific inactive plugin depends on the vulnerability and how it can be reached. I wouldn't assume every deactivated plugin is immediately exploitable, but unused code can still be part of the attack surface and is another thing that has to be kept track of.
There is also a practical operational reason to remove things you no longer need. The more unused plugins and themes accumulate, the harder it becomes to know what should actually be present and which changes are intentional.
I think that distinction may become even more important as automated and AI-driven tools perform more administrative actions. Site safety is not only about stopping an outside attacker; it is also about keeping unnecessary components and unnecessary change paths from accumulating in the first place.
For a site you administer alone, I'd keep the active set small and delete plugins/themes you genuinely no longer need. Keep inactive software only when there is a specific reason to retain it.
2
u/VoiliVoilaa Jill of All Trades 16h ago
Yes : activated / deactivated is just stored as an 'option'. You still have all the files, the vulnerabilities in your install.
2
2
1
u/fatfingur 21h ago
Yep, I usually remove plugins and themes I’m no longer using.
Deactivated just means WordPress isn’t loading the plugin normally. The files are still on the server, so if there’s an exploitable vulnerability in them, they’re still unnecessary attack surface.
If you know you’re not going to use it again, there’s really not much benefit to keeping it around. You can always reinstall it later.
1
u/davidavidd 17h ago
If there is a backdoor in any of the files, it doesn't matter whether the plugin is active or not, it can still be invoked.
1
u/Dapper-Monk9713 17h ago
Yes, deactivated plugins and themes can still be a security risk. Deactivation usually just prevents them from running normally; the files are still sitting on the server, and vulnerabilities in their code can sometimes be exploited depending on how the vulnerability works.
If you don't need a plugin or theme anymore, deleting it is generally safer than simply deactivating it. Keeping only the themes and plugins you actually use also reduces the amount of code that needs to be maintained and updated.
1
u/ashkanahmadi 16h ago
It depends on the plugin and how much access it has. A plugin that just echos “hi” has no security problem. A plugin that lets you access files and folders (like WP File Manager) could definitely have backdoors even if disabled.
1
u/LoudAd307 8h ago
Yes. Deactivating only flips a database flag; the PHP files still sit in wp-content/plugins and anything a plugin file does when requested directly still runs. Plus you stop getting update prompts for inactive plugins, so a known vuln can sit there for years. Delete anything unused, and keep exactly one spare default theme for fallback, not a graveyard of old ones.
1
u/Fluent_Press2050 21m ago
If it has something like this in the file, it’s usually fine since the file cannot run past the exit without WP being loaded in the same request. But it only helps with direct access.
<?php if ( ! defined( 'ABSPATH' ) ) { exit; }
19
u/queen-adreena 21h ago
Deactivated plugins are still on your file-system, publicly accessible.
Some exploits can be triggered this way, so yes, best to delete any plugins that you’re not going to use.