Last updated: November 23, 2026 · Skill level: intermediate
If your WordPress site looks hacked but the malware scan says clean, believe the symptoms, not the scan. Scanners only inspect what they can reach: a remote scanner sees the rendered page, and a plugin scanner sees files inside its scan scope. Malware in the database, in must-use plugins, outside the WordPress folder, or behind a stolen login slips past both.
TL;DR: A clean result means “nothing found where I looked.” Reproduce the symptom as a logged-out visitor and as Googlebot, verify core and plugin checksums, list must-use plugins and drop-ins, search the database, audit administrator accounts and application passwords, and check server files such as .user.ini and the crontab. The ten-step checklist below runs every check with WP-CLI, curl, and SQL.
Can a WordPress site be hacked if the malware scan is clean?
Yes. A clean scan is common on hacked WordPress sites because attackers design malware to avoid the places scanners check. Payloads hide in database rows, load from must-use plugins, sit outside the WordPress directory, or only fire for search engine visitors. Some “hacks” contain no malicious code at all, just a stolen administrator account.
The vendors say this themselves. Sucuri states that its free remote scanner, SiteCheck, sees only what appears at the browser level and will not detect anything on the server side. Wordfence makes the same argument from the other direction: its scanner runs on the server precisely because remote scanners cannot read your source code (May 2018).
The scale of what hides is large. In its 2022 Hacked Website Threat Report, Sucuri found at least one backdoor on 69.63% of compromised sites at the point of cleanup. In its 2023 report (published June 2024), Sucuri removed 21,062 backdoors and found SEO spam on 42.22% of infected sites. Backdoors and SEO spam are exactly the two infection types that stay invisible to a site owner.
Why do malware scanners miss WordPress infections?
Scanners miss infections for seven repeatable reasons: they scan remotely, the malware is conditional, the payload lives only in the database, the code loads from must-use plugins or drop-ins, the files sit outside the scan scope, a cache serves an old infected page, or the attacker used a valid login instead of code. Each blind spot has a specific check.
| Blind spot | Why the scan comes back clean | What to check instead |
|---|---|---|
| Remote-only scanning | The scanner fetches public pages and never sees PHP files, the database, or server config | A server-side scan plus the manual checks below |
| Conditional (cloaked) malware | The payload fires only for Google referrers, mobile devices, Googlebot, or logged-out visitors | curl requests with a Googlebot user agent and a Google referrer |
| Database-only payloads | Injected scripts and spam links live in wp_posts or wp_options, not in files | SQL searches for <script, eval(, and base64 |
| Must-use plugins and drop-ins | They load automatically, cannot be disabled from wp-admin, and are easy to overlook | wp plugin list --status=must-use and --status=dropin |
| Files outside the scan scope | Malware sits above the WordPress root, in another site in the same account, or in non-PHP file names | find across the whole hosting account |
| Stale cached pages | The page cache or CDN keeps serving an injected page after the source is clean, or masks it during the scan | Purge every cache layer, then retest |
| Compromised accounts, no malware | A rogue admin, application password, or stolen SFTP login leaves nothing for a signature to match | User, application password, and access log audit |
Remote scanners versus server-side scanners
A remote scanner such as SiteCheck works like a browser. It is useful when your site is too broken to run a plugin, but it can only flag malware that renders in HTML. A server-side scanner such as Wordfence, MalCare, or your host’s scanner reads files directly. Sucuri sells its own server-side scanner, which looks for obfuscated code, backdoors, and phishing pages, for exactly this reason.
Conditional malware that hides from you
Most spam redirects and SEO spam check who is asking before they act. You are logged in, on a desktop, typing the URL directly, which is the one visitor profile the malware ignores. A remote scanner crawling from a data center may be ignored too. Our guide to a WordPress site redirecting to spam covers the conditions attackers use and how to trace each one.
Must-use plugins and drop-ins
Files in wp-content/mu-plugins load on every request. The WordPress developer handbook notes that must-use plugins cannot be disabled from wp-admin and appear only under a separate Must-Use tab. Drop-ins such as object-cache.php and advanced-cache.php load even earlier. Attackers favor both because few owners ever look there.
Which symptoms point to a hidden infection?
Symptoms tell you where to look first. Spam pages in Google results point to the database or a cloaking script. Redirects point to .htaccess, PHP files, or injected JavaScript. New administrators point to a stolen login or a backdoor that recreates them. Reinfection after cleanup almost always means a backdoor you have not found yet.
| Symptom | Most likely location | Start with step |
|---|---|---|
Spam or Japanese-language pages in site:yourdomain.com results | Database, cloaking script in a theme or mu-plugin | 2, 6 |
| Visitors from Google or mobile get redirected | .htaccess, wp-config.php, theme functions.php, injected JavaScript | 2, 3, 9 |
| Administrator accounts you did not create | Stolen credentials, backdoor, or malicious mu-plugin recreating users | 4, 7 |
| Malware returns days after cleanup | Backdoor, scheduled task, or server crontab | 4, 5, 8, 9 |
| Host warns about outgoing spam or high CPU | PHP mailer script or file outside the WordPress root | 5, 9 |
| Google Search Console “Security issues” warning | Whatever Googlebot sees, which may differ from what you see | 2 |
How do I check a WordPress site the scanner says is clean?
Work through ten checks in order: back up, reproduce the symptom as Googlebot, verify checksums, list hidden plugins, hunt for stray PHP files, search the database, audit users, review scheduled tasks, inspect server config, then purge caches and retest. You need SSH access and WP-CLI. Each step takes five to fifteen minutes on a typical site.
Run the commands from the WordPress root. If your table prefix is not wp_, run wp db prefix and substitute it in the SQL.
1. Back up and preserve evidence
Take a full copy before you change anything. You need it to roll back a mistake and to compare file times later.
wp db export ~/evidence-db.sql
tar -czf ~/evidence-files.tar.gz .
2. Reproduce the symptom as a visitor and as Googlebot
Fetch the same page three ways and compare. A Location header or different HTML for Googlebot proves cloaking even when every scanner is silent.
curl -sI https://example.com/ | grep -i location
curl -s https://example.com/ -o normal.html
curl -s -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
-e "https://www.google.com/" https://example.com/ -o googlebot.html
diff normal.html googlebot.html | head -50
Then open Google Search Console, run URL Inspection on the page, and use “View crawled page” to see the HTML Google actually received. Check the Security issues report as well. Search Google for site:example.com plus words like casino or viagra to find spam URLs you never published.
3. Verify core and plugin checksums
Checksums compare every file against the official WordPress.org copy, so they catch modified files no signature has seen before. Our guide to verifying WordPress core checksums explains how to read the output.
wp core verify-checksums --include-root
wp plugin verify-checksums --all
Premium plugins and themes have no WordPress.org checksums. Replace them with fresh copies from the vendor instead of trusting the installed files.
4. List must-use plugins and drop-ins
wp plugin list --status=must-use
wp plugin list --status=dropin
ls -la wp-content/mu-plugins/ wp-content/*.php
Every file here should belong to your host or a plugin you recognize. A file named like a system component (health-check.php, wp-cache-loader.php) that no plugin installed is a prime suspect. If you find one, follow our full guide on how to find a backdoor in WordPress before deleting anything.
5. Hunt for stray and recently changed PHP files
find wp-content/uploads -type f -name "*.php*"
find ~ -type f -name "*.php" -mtime -14 -not -path "*/cache/*" | head -100
find ~ -maxdepth 2 -type f -name "*.php" -newer wp-config.php
The uploads folder should hold media, not PHP. The second command searches the whole hosting account, not only the WordPress folder, which catches files a plugin scanner skips. Treat file names as a hint only. Open each unknown file and look for eval, base64_decode, gzinflate, or long encoded strings.
6. Search the database for injected code
wp db query "SELECT ID, post_title, post_status FROM wp_posts WHERE post_content LIKE '%<script%' OR post_content LIKE '%eval(%';"
wp db query "SELECT option_name, LENGTH(option_value) AS size FROM wp_options WHERE autoload IN ('yes','on') ORDER BY size DESC LIMIT 20;"
wp db query "SELECT option_name FROM wp_options WHERE option_value LIKE '%base64_decode%' OR option_value LIKE '%<script%';"
Legitimate posts sometimes contain scripts, such as embeds or analytics, so review each hit instead of bulk-deleting. For a full walkthrough, see how to check wp_options for malicious entries.
7. Audit administrators and application passwords
wp user list --role=administrator --fields=ID,user_login,user_email,user_registered
wp user application-password list 1
Run the second command for every administrator ID. An application password lets someone use the REST API without your password or two-factor code, and no malware scanner reports it. Also compare the WP-CLI user count with the count in the Users screen. A mismatch means code is hiding an account from wp-admin.
8. Review WordPress scheduled tasks
wp cron event list --fields=hook,next_run_relative,recurrence
Every hook should map to core or a plugin you use. A random-looking hook name that runs hourly is a common reinfection mechanism: you delete the malware, and a scheduled task downloads it again.
9. Inspect server configuration outside WordPress
grep -rn "auto_prepend_file|auto_append_file" ~/public_html --include=".user.ini" --include="php.ini" --include=".htaccess"
find ~ -name ".htaccess" -newer wp-config.php
crontab -l
An auto_prepend_file directive makes PHP run an attacker’s file before WordPress loads, and many WordPress scanners never read these config files. Legitimate security plugins such as Wordfence also use this directive for their firewall, so check which file it points to. A server crontab entry you did not create is a reinfection source that survives a full WordPress reinstall.
10. Purge every cache and retest
wp cache flush
wp transient delete --all
Then clear your page cache plugin, the host’s server cache, and the CDN. Repeat the curl requests from step 2 and run your scanner again. Results that change after a purge tell you the cache was hiding or preserving the infection.
Should I change my scanner’s settings or run a second scanner?
Do both. Widen your existing scanner’s scope first, because default settings trade coverage for speed. Then run one scanner of a different type, so a remote scan backs up a server-side scan or the reverse. Two engines with different signatures and access levels catch more than one engine run twice.
In Wordfence, open Scan, then Scan Options, and enable the high-sensitivity settings described in the Wordfence scan options documentation. “Scan files outside your WordPress installation” matters most: it is off on standard installs, so a file one directory above your site is never checked. Expect a longer scan and higher server load while these options are on.
| Scanner type | Sees | Misses | Examples |
|---|---|---|---|
| Remote | Rendered HTML, blocklist status, visible redirects | PHP files, database, server config, cloaked payloads | Sucuri SiteCheck |
| Plugin (server-side) | Files in its scan scope, known signatures, core file changes | Files outside scope by default, account abuse, some database payloads | Wordfence, MalCare, Jetpack Scan |
| Host-level | Every file in the account, including other sites | Database content, WordPress-specific logic | Imunify360, host malware scanners |
| Manual checks | Anything you search for | Only what you forget to check | This checklist |
What if I find nothing after all ten checks?
If all ten checks come back clean, the cause may sit outside WordPress: a compromised hosting account, a shared server, a malicious browser extension on your own computer, or DNS changed at your registrar. Change every password from a clean device, enable two-factor authentication, and ask your host for a server-level scan and access logs.
Also rule out false alarms. A redirect may come from an ad network script, a misconfigured caching plugin, or a CDN rule. Spam URLs in Google can be old results from a previous hack that Google has not recrawled yet. Request recrawls in Search Console and watch whether new spam URLs keep appearing. If they do, the infection is active. If they don’t, you are looking at history.
Bring in a professional when the site handles payments or personal data, when reinfection happens twice, or when you cannot get SSH access. A cleanup service can see host logs and server processes you cannot.
Frequently asked questions
Can Wordfence miss malware?
Yes. Wordfence scans files on the server against known signatures and core checksums, but its default scope skips files outside the WordPress installation. It also cannot flag a stolen administrator login or an application password, because neither involves malicious code. Widen the scan options and pair it with manual checks.
Why does Sucuri SiteCheck say my site is clean?
SiteCheck is a remote scanner. Sucuri states that it only sees what appears at the browser level, so it cannot detect backdoors, server-side scripts, or database payloads that do not render. Conditional malware may also hide from the scanner’s own requests. Use it as one signal, never as proof.
Why does my WordPress site keep getting reinfected after cleanup?
Reinfection means something survived: a backdoor file, a malicious must-use plugin, a scheduled task, a server crontab entry, or the original vulnerability that let the attacker in. Find and remove all of them, update or remove the vulnerable plugin, and rotate every password and the salts in wp-config.php.
How do I see what Google sees on my hacked site?
Use URL Inspection in Google Search Console and open “View crawled page” to see the HTML Googlebot received. You can also fetch the page with curl using a Googlebot user agent and a Google referrer, then compare it with a normal request. Different HTML means the site is cloaking.
Can a WordPress site be hacked without any malware files?
Yes. An attacker with a valid administrator login can publish spam, change settings, or add users without uploading a single file. Database-only injections also leave the file system untouched. That is why a user audit belongs in every investigation, as covered in our guide to finding and removing rogue WordPress admin accounts.


Leave a Reply