WordPress Security ServicesMalware Removal
Malware Scanning Guide

How to Scan Your WordPress Site for Malware: Free Tools, Plugins and Manual Checks

Most site owners find out about malware from a scanner, and most of them trust its "all clean" result a little too much. Here's how the different kinds of WordPress malware scanners work, where each one is blind, and how to combine them so you actually find the infection.

Sergey By Sergey, WordPress security specialist Updated 6 min read
In this guide
  1. The four kinds of WordPress malware scanner
  2. How to scan a WordPress site for malware properly
  3. Online WordPress malware scanners: useful, but limited
  4. Security plugins: strong on files, weaker on context
  5. Scanning the WordPress database for malware
  6. Scanning a plugin or theme before you install it
  7. Why a “clean” scan doesn’t always mean clean
  8. What to do when the scanner finds malware
  9. When to use a manual malware scanning service

The four kinds of WordPress malware scanner

People say “malware scanner” as if it were one thing. In practice there are four quite different tools, and each one looks at a different part of your site.

Scanner type Examples What it can see What it misses
Online (remote) scanner Sucuri SiteCheck and similar free website scanners The public HTML of the pages it downloads; known blocklists Everything on the server: backdoors, unlinked files, most database content, malware that hides from bots
WordPress security plugin Wordfence, MalCare, Jetpack Scan Files inside your WordPress install, compared with known malware and with original copies; some database content Files outside WordPress, server settings, malware that disables or fools the plugin, custom code without a known signature
Hosting / server scanner Your host’s scanner (often Imunify360 or the host’s own tool) Every file in your hosting account, including outside WordPress Usually the database; it flags files without understanding how they connect or how they got there
Manual review A person with SSH, WP-CLI and database access Anything: files, database, cron jobs, logs, server config, visitor behavior Only what the person doesn’t think to check, which is why experience matters

No single scanner covers everything. The trick is to combine them. If you’re choosing a specific product, see my honest comparison of the best WordPress malware scanners.

How to scan a WordPress site for malware properly

This is the order I’d follow if you suspect an infection:

  1. Start from the outside. Run an online scanner and check Google Search Console under Security issues. This shows what visitors and Google are seeing.
  2. Scan the files on the server. Run a security plugin scan, or your host’s scanner if it has one. Save the list of flagged files.
  3. Compare core and plugin files against the originals. With SSH, run wp core verify-checksums and wp plugin verify-checksums --all. This catches modified files even when no signature matches. My free, open-source wptriage scanner does the same check for themes as well, and adds the uploads folder, .htaccess files, and the database, without changing anything.
  4. Check the places scanners skip. Look in wp-content/uploads for PHP files, wp-content/mu-plugins, every .htaccess file, and the cron jobs in your hosting panel.
  5. Check the database. Look for unknown administrator accounts and for <script> tags in posts, options and widgets (more on this below).
  6. Test like a visitor. Open the site on a phone using mobile data, and click through from a Google result. Some malware only runs in exactly those situations.

If steps 1 and 2 come back clean but you still see problems, steps 3 to 6 are where the infection usually turns up.

Online WordPress malware scanners: useful, but limited

An online scanner works like a visitor. It downloads a few pages of your site and looks at the HTML for known malicious scripts, spam links, and iframes, and it usually checks blocklists such as Google Safe Browsing.

That makes it great for one thing: a quick, free check of what the public sees. It also means it can only ever see the output of your site, never the code that produces it. A backdoor in wp-content/uploads produces no output at all, so an online scanner will never see it. Neither will malware that only fires for visitors coming from Google, if the scanner doesn’t arrive from Google.

Use an online scanner as your first check, not your last.

Security plugins: strong on files, weaker on context

Plugins like Wordfence scan the files on your server. They compare them with known malware signatures and with the original versions of WordPress core, themes, and plugins. This finds most common infections, and running a scan costs nothing.

The weak spots:

  • Custom or heavily obfuscated code that doesn’t match any known signature.
  • Malware that targets the plugin itself. Some infections disable security plugins or add their own files to the plugin’s ignore list.
  • Anything outside the WordPress folder, such as server configuration or other sites in the same account.
  • The “why”. A plugin tells you which files are bad. It doesn’t tell you which plugin was vulnerable or which password leaked.

Scanning the WordPress database for malware

This is the biggest gap in most scans. Malware hides in the database because file scanners rarely check it thoroughly: scripts injected into post content, spam links in widgets, malicious code stored in wp_options, and fake administrator accounts.

You can do a basic database scan yourself with a few queries. Replace wp_ with your table prefix:

-- Scripts or iframes inside posts and pages
SELECT ID, post_title FROM wp_posts
WHERE post_content LIKE '%<script%' OR post_content LIKE '%<iframe%';

-- Suspicious code in options and widgets
SELECT option_name FROM wp_options
WHERE option_value LIKE '%<script%' OR option_value LIKE '%eval(%' OR option_value LIKE '%base64_decode%';

-- Every administrator account
SELECT u.ID, u.user_login, u.user_email, u.user_registered FROM wp_users u
JOIN wp_usermeta m ON m.user_id = u.ID
WHERE m.meta_key = 'wp_capabilities' AND m.meta_value LIKE '%administrator%';

These queries only read data, so they’re safe to run in phpMyAdmin’s SQL tab. Some matches will be legitimate, such as an analytics snippet you added on purpose. If you find something you don’t recognize, read my page on WordPress database malware removal before deleting anything. A careless edit can break serialized data.

Scanning a plugin or theme before you install it

You can also scan before anything reaches your site. If you’ve downloaded a theme or plugin zip from anywhere other than WordPress.org or the official vendor, unzip it on your computer and search the PHP files for the patterns below (eval(, base64_decode(, long encoded strings) before uploading it. My 10-minute plugin and theme check walks through it step by step. Better still: don’t install it. Nulled (pirated) themes and plugins are one of the most common sources of the backdoors I remove.

Why a “clean” scan doesn’t always mean clean

Scanners look for what they already know about. Attackers know this and design around it. These are the most common reasons a site scans clean but is still infected:

  • Conditional malware. Code that only runs for mobile users, first-time visitors, or traffic from Google. Scanners and logged-in admins never trigger it.
  • Obfuscation. Code that’s encoded, split into pieces, or built at runtime, so it matches no signature.
  • Malware in the database, not in files.
  • Code outside WordPress: .htaccess rules, auto_prepend_file settings, or a hosting cron job that reinstalls the malware every few hours.
  • A neighboring site. Another infected site in the same hosting account keeps reinfecting yours.

A pattern I see a lot: the owner gets a “Deceptive site ahead” warning, runs three different scanners, and all three say the site is clean. The culprit is usually a few lines added to the theme’s functions.php. They load a script from another domain, but only for visitors who aren’t logged in and who arrive from a search engine. The scanners never qualified as “victims”, so they never saw it. A side-by-side comparison with the original theme found it in minutes.

What to do when the scanner finds malware

Don’t just click “delete all”. Deleting a flagged file without understanding it can break your site, and it rarely removes everything. Malware usually comes as a set: the visible payload plus one or more backdoors to get back in.

Instead:

  1. Back up the site as it is.
  2. Write down every flagged file and when it was modified. The oldest one often points to the entry point.
  3. Replace core, plugin, and theme files with clean copies rather than editing them.
  4. Check the database and server-level files, which the scanner probably didn’t cover.
  5. Find and fix the way the attacker got in.

My step-by-step guide on how to remove malware from WordPress walks through all of this.

When to use a manual malware scanning service

A manual review makes sense when the tools disagree with what you’re seeing: the scanners say clean but the redirects continue, or Google keeps flagging the site, or the malware returns after every cleanup. It also makes sense for online stores, where missing a card skimmer has real consequences.

Every cleanup I do starts with a manual investigation of the files, database, server configuration and logs, not just a scan. If you’re not sure whether your site is infected at all, send me the URL and what you’ve noticed. I’ll tell you honestly whether it looks like malware and what I’d check first.

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

What is the best free WordPress malware scanner?

There isn't one that catches everything. A good free setup is an online scanner such as Sucuri SiteCheck for a quick outside check, plus Wordfence's free scan for the files on your server. Add WP-CLI's checksum commands if you have SSH. Using two or three methods together finds far more than any single tool.

Can an online scanner detect all malware on my WordPress site?

No. An online scanner only sees the pages it downloads, the same way a visitor does. It can't see backdoors, malicious files that aren't linked anywhere, database content that isn't shown on those pages, or malware that hides from scanners. It's a quick first check, not a verdict.

Is Wordfence enough to keep my site clean?

Wordfence is a solid tool and worth running. But a scanner tells you what's wrong; it doesn't tell you how the attacker got in. If the vulnerable plugin or stolen password is still there, the site gets reinfected however good the scanner is. Treat it as one layer, together with updates, strong passwords, two-factor login and backups.

My scanner says the site is clean, but I still see redirects. What now?

Believe the symptoms, not the scanner. Conditional redirects are designed to stay hidden from scanners and logged-in admins. Test the way an affected visitor would (phone on mobile data, clicking through from Google), and check .htaccess, the database, and theme files by hand.

Do malware scans slow down my website?

Plugin scans use server resources while they run, which can be noticeable on cheap shared hosting. Schedule them for quiet hours, or use a scanner that does the analysis on its own servers. Online scanners don't load your server more than a normal visit.

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 →