In this guide
- The four kinds of WordPress malware scanner
- How to scan a WordPress site for malware properly
- Online WordPress malware scanners: useful, but limited
- Security plugins: strong on files, weaker on context
- Scanning the WordPress database for malware
- Scanning a plugin or theme before you install it
- Why a “clean” scan doesn’t always mean clean
- What to do when the scanner finds malware
- 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:
- Start from the outside. Run an online scanner and check Google Search Console under Security issues. This shows what visitors and Google are seeing.
- 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.
- Compare core and plugin files against the originals. With SSH, run
wp core verify-checksumsandwp 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,.htaccessfiles, and the database, without changing anything. - Check the places scanners skip. Look in
wp-content/uploadsfor PHP files,wp-content/mu-plugins, every.htaccessfile, and the cron jobs in your hosting panel. - Check the database. Look for unknown administrator accounts and for
<script>tags in posts, options and widgets (more on this below). - 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:
.htaccessrules,auto_prepend_filesettings, 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:
- Back up the site as it is.
- Write down every flagged file and when it was modified. The oldest one often points to the entry point.
- Replace core, plugin, and theme files with clean copies rather than editing them.
- Check the database and server-level files, which the scanner probably didn’t cover.
- 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.