WordPress Security ServicesMalware Removal
Before You Install

How to Check a WordPress Plugin or Theme for Malware Before You Install It

The easiest malware cleanup is the one you never need. A surprising number of the infections I remove came in with a plugin or theme the owner installed themselves, usually a "free" premium one from a download site. Here's how to check a plugin or theme before it touches your site.

Sergey By Sergey, WordPress security specialist Updated 2 min read
In this guide
  1. 1. Check where it comes from
  2. 2. Check its track record
  3. 3. Look inside the zip
  4. 4. Test it before it goes live
  5. 5. Keep checking after you install it

1. Check where it comes from

This one step prevents most problems:

  • Good sources: the official WordPress.org directory, or the developer’s own website or a well-known marketplace you bought it from.
  • Bad sources: “free download” sites for premium plugins, file-sharing links, forums, Telegram channels, and anything labelled nulled, GPL club from an unknown seller, or cracked.

If a premium plugin is offered for free by someone who isn’t the developer, assume it contains a backdoor. See why nulled themes and plugins are infected.

2. Check its track record

  • Last updated: within the last few months is good; years ago is a warning sign.
  • Active installations and reviews: look for reviews mentioning security or “hacked”.
  • Known vulnerabilities: search the plugin’s name in a vulnerability database such as WPScan, Patchstack or Wordfence Intelligence. Make sure the version you’re installing has every known issue fixed.
  • Support forum: unanswered reports of security problems are a red flag.

3. Look inside the zip

Unzip it on your computer (not on your server) and search the PHP and JavaScript files for patterns malware relies on:

grep -rnE "eval\(|base64_decode\(|gzinflate\(|str_rot13\(|assert\(|create_function" .
grep -rnE "wp_create_user|wp_insert_user|add_role" .
grep -rlE '.{3000,}' --include="*.php" .

Legitimate plugins use some of these, so read the matches in context. Real red flags:

  • long blocks of encoded or scrambled text, especially combined with eval(;
  • code that creates users or administrators outside of a normal settings page;
  • code that downloads and runs something from a remote URL;
  • files with names that don’t fit the plugin, like wp-vcd.php, class.theme-modules.php, or random strings;
  • PHP code hidden inside image or font files.

For premium plugins you bought, compare the zip with a fresh download from your account. They should be identical.

4. Test it before it goes live

Install it on a staging copy of your site first. Many hosts offer one-click staging. Afterwards, check:

  • no new admin users appeared;
  • no unexpected files appeared outside the plugin’s own folder;
  • the site doesn’t start loading scripts from unfamiliar domains.

5. Keep checking after you install it

Plugins change. Turn on vulnerability alerts, through your security plugin or a service like Patchstack or Wordfence. Update regularly, and remove plugins you stop using. My WordPress security checklist covers the rest.

From my cleanup work: owners rarely suspect the plugin they installed themselves. In a typical case the site was fine for months, then a “free” copy of a premium page builder was installed to save $60. Two days later, the first spam pages appeared. The backdoor was right there in the zip. A one-minute search for eval( would have found it.

Sergey, WordPress Security Specialist
About the author
Sergey, WordPress Security Specialist

10 years in WordPress security and incident investigation, and more than 200 websites cleaned of malware. Top Rated on Upwork with a 100% Job Success score. More about me

Frequently Asked Questions

Are plugins from WordPress.org safe?

They're reviewed when first submitted, and the directory removes plugins with known problems, so they're far safer than random downloads. But they can still contain vulnerabilities, and a plugin can change hands or be abandoned. Check when it was last updated and whether it has known, unpatched vulnerabilities.

Can I scan a plugin zip with my antivirus or VirusTotal?

Yes, it's a useful quick check, and VirusTotal accepts file uploads. But desktop antivirus engines miss a lot of PHP malware. A clean result is reassuring, not proof. Looking at the code for the warning signs below catches more.

Is a plugin that hasn't been updated in a year dangerous?

Not automatically, but it's a risk. If a vulnerability is found, there may be nobody to fix it. Prefer actively maintained alternatives, especially for plugins that handle uploads, forms, logins or files.

Need a hand?

Let me clean your WordPress site for you

Send me your site URL and what you're seeing. I'll reply with what I think is going on and the next step.

$95 per infected site · 1-month guarantee · direct contact with the specialist

Get My Site Cleaned →