---
title: Is that free WordPress theme safe? 6 checks before you install it
url: https://www.dzn-studios.com/blog/detecting-malicious-codes-hidden-within-wordpress-themesplugins/
author: Mark, dzn studios
published: 2017-08-07
updated: 2026-11-05
category: Web
description: Before you install a WordPress theme or plugin, check it. Six ways to find hidden malware, backdoors and spam links, from VirusTotal to WP-CLI checksums.
---

# Is that free WordPress theme safe? 6 checks before you install it

**The short answer**

To check a WordPress theme or plugin for malicious code: only download it from WordPress.org or the developer’s own site, **scan the zip with VirusTotal**, search the code for risky functions such as `eval(` and `base64_decode(`, test it on a staging copy of your site, then verify file checksums with WP-CLI and keep a scanner such as Wordfence running once it is live.

![WordPress logo over lines of JavaScript code](https://www.dzn-studios.com/images/blog/wordpress-malware/cover.webp?v=1794377134)

Free and “nulled” themes and plugins are one of the easiest ways for malware, backdoors and hidden spam links to get onto a WordPress site. The checks below take about fifteen minutes, and they are far cheaper than cleaning up a hacked site afterwards.

## Step 1: Check where it came from

Most malicious themes and plugins are never “hacked”. They are downloaded from the wrong place. Before you look at a single line of code:

- Download free themes and plugins only from [WordPress.org](https://wordpress.org/plugins/), or from the developer’s own website.
- Buy premium products from the developer or a reputable marketplace, never from a “free download” site.
- Check the listing: when was it last updated, how many active installs does it have, and are support questions being answered?
- Never use nulled versions of paid themes or plugins. The person who removed the licence check can add anything else they like.

## Step 2: Scan the zip file with VirusTotal

Go to [VirusTotal](https://www.virustotal.com/) and upload the theme or plugin zip before you install it. It runs the file past dozens of antivirus engines at once. If several engines flag it, delete it. A single low-confidence detection is often a false positive, but treat it as a reason to look more closely in the next step.

## Step 3: Search the code for red flags

Unzip the file and search it for the functions that malware relies on. On a Mac or Linux machine, run this in the unzipped folder:

```
grep -RnE "eval\(|base64_decode\(|gzinflate\(|str_rot13\(|assert\(|shell_exec\(|passthru\(|system\(|create_function\(" .
```

Then look for long blocks of unreadable text, which is how most malware hides itself:

```
grep -RnE "[A-Za-z0-9+/=]{300,}" --include="*.php" .
```

What to look for in the results:

- **`eval(` wrapped around `base64_decode(` or `gzinflate(`.** Code that decodes a hidden string and then runs it is the classic backdoor pattern.
- **Long encoded strings** in a theme’s `functions.php` or `footer.php`.
- **Links to unrelated sites** hard-coded into the footer. Free themes have long been used to plant spam backlinks.
- **Requests to unknown domains** using `wp_remote_get`, `file_get_contents` or `curl`.

A match is a lead, not proof. Plenty of legitimate code uses `base64_decode`. What matters is whether the code makes sense for what the theme or plugin is meant to do.

## Step 4: Test it on a staging site

Install anything new on a staging copy of your site, not the live one. Many hosts offer one-click staging. Watch for new admin users appearing, unexpected redirects, new files in `wp-content/uploads`, or outgoing requests you didn’t expect.

## Step 5: Verify file checksums with WP-CLI

If you have command-line access, WP-CLI can compare your files with the official versions published on WordPress.org:

```
wp core verify-checksums
wp plugin verify-checksums --all
```

Any file reported as modified, or present when it shouldn’t be, needs investigating. This only works for WordPress core and plugins hosted on WordPress.org; premium plugins have no public checksums to compare against.

It is also worth checking for PHP files in your uploads folder, which should only ever contain media:

```
find wp-content/uploads -name "*.php"
```

## Step 6: Keep a security scanner running

Checks before installation catch most problems, but plugins change with every update. Keep a scanner running on the live site:

- **[Wordfence](https://wordpress.org/plugins/wordfence/)**: a firewall plus a malware scanner that compares your files with the originals and looks for known malicious code. The free version is enough for most small sites.
- **[Sucuri SiteCheck](https://sitecheck.sucuri.net/)**: a free remote scan of your public pages for malware, spam and blocklisting. It can’t see your server files, so use it alongside a plugin.
- **[Patchstack](https://patchstack.com/database/)** or **[WPScan](https://wpscan.com/)**: databases of known vulnerabilities in themes and plugins, so you know when something you have installed needs an urgent update.

**What about Exploit Scanner and Theme Authenticity Checker?** Earlier versions of this guide recommended those two plugins. Neither has been updated in years, so they are no longer a good choice. The steps above replace them.

## Frequently asked questions

### What is a nulled WordPress theme or plugin?

A nulled theme or plugin is a paid product with its licence check removed, shared for free on unofficial sites. They are one of the most common ways malware gets onto WordPress sites, because whoever cracked the code can add anything they like to it. Never install one on a real website.

### Can plugins from WordPress.org contain malware?

It is rare, because the WordPress.org team reviews submissions and removes plugins found to be malicious. But it has happened, usually when a popular plugin changes owner and the new owner adds bad code in an update. Keep plugins updated, remove ones you don’t use, and keep a security scanner running.

### How do I know if my WordPress site is already infected?

Common signs are admin users you didn’t create, visitors being redirected to spam or scam sites, a “This site may be hacked” warning in Google results, unfamiliar PHP files in the uploads folder, and core or plugin files that fail a checksum check. Run a full scan with a tool such as Wordfence or Sucuri straight away.

### Does base64_decode in a plugin mean it is malicious?

Not on its own. Legitimate code uses base64_decode for perfectly normal reasons, such as handling images or data from an API. It becomes suspicious when it is combined with eval, wrapped around long unreadable strings, or hidden in files that have no reason to contain it. Treat search results as leads to investigate, not proof.
