A client messaged me in a panic: their MalCare dashboard said "Your site is hacked and needs attention", with 1 malicious file listed under "other files". On the free plan, MalCare won't show which file. The path sits behind the paid clean-up upgrade.
The site was a busy real estate agency running WordPress, Divi and about 40 plugins, with more than 69,000 files on the server. Asking "which file?" is a hard question at that size.
It took a full day to answer, and the answer surprised me: the site wasn't hacked at all. MalCare had flagged an old, forgotten copy of a PHP app sitting outside WordPress, in a folder nobody remembered existed.
This post covers the method I used, so you can do the same when a scanner shows a count but no path.
Step 1: Take a copy before you touch anything
The client had downloaded a full copy of the files and the database the night the alert appeared. That copy matters for two reasons:
- You can scan it locally with your own tools, without slowing the live site.
- If the infection is real, you keep the evidence.
If you're on SiteGround, cPanel or similar, a zip of public_html plus a database export from phpMyAdmin is enough.
Step 2: Verify WordPress core and plugins against official checksums
This is the fastest way to rule out most of the site. WordPress.org publishes a checksum for every core file and every plugin version in its directory. WP-CLI compares them for you:
wp core verify-checksums
wp plugin verify-checksums --all
On this site, core and all 22 wordpress.org plugins matched exactly. That cleared thousands of files in a couple of minutes.
Premium plugins (Divi, EPL extensions and the like) have no public checksums, so they need a manual or static scan. I ran a PHP tokenizer scan over them, looking for eval, base64_decode, gzinflate, assert, preg_replace with /e, and variable functions. Everything I found was normal plugin code.
Step 3: Don't trust file extensions
Attackers love hiding PHP in files named .jpg or .ico. Check what a file really is, not what it's called:
find wp-content/uploads -type f \( -iname '*.jpg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.webp' \) \
-exec file --mime-type {} + | grep -v ': image/'
This turned up one oddity: a .jpg in uploads/2023/04 that was actually a 239-byte HTML page with a meta refresh. It looked bad, but it turned out to be harmless. Back in 2023 an import plugin tried to download a property photo, the image server returned a bot-challenge page, and the plugin saved that page as a .jpg.
We deleted it. MalCare still said 1 malicious file. So that wasn't it.
Step 4: Check the places malware likes to hide
Next I checked the usual hiding spots one at a time:
| Location | What to look for |
|---|---|
wp-content/mu-plugins/ |
Must-use plugins load on every request and don't appear in the normal plugin list. Here it held only MalCare's own loader. |
| Site root | Unknown .php files (droppers like Phantom Shell leave names such as wp-cover.php), a modified index.php, .htaccess rules that redirect or prepend files. |
wp-config.php |
Extra include lines or code above the "stop editing" comment. |
| Database | wp_options rows holding scripts, header and footer injection plugins, rogue admin users, unexpected cron events. |
| Tag Manager | Third-party scripts loaded from domains that have expired or changed hands. |
The database was clean and the admin users were all known. The one real issue was a Google Tag Manager tag that still loaded a script from a dead third-party domain on every page. If someone re-registers a domain like that, they can push their own JavaScript to your visitors. It wasn't the file MalCare flagged, but we removed the tag anyway.
Step 5: Narrow it down with an elimination test
When static scanning finds nothing and the scanner won't tell you the path, let the scanner do the searching for you:
- List the folders that aren't part of the running site: old backups, copies,
*~files, stray zips. - Move a group of them outside the web root. Don't delete them yet.
- Run a fresh scan.
- If the alert clears, the file is in that group. If not, move the group back and try the next one.
mkdir -p ~/quarantine
mv ~/public_html/some-old-folder ~/quarantine/
The move is reversible, nothing is lost, and every scan halves what's left to search.
On the client's site, the alert cleared as soon as we moved out an XML folder full of leftovers.
What was in the XML folder
public_html/XML/ held FeedSync, a standalone PHP app that converts property listing feeds (REAXML from the agency's CRM) into something the website can import. Alongside the live install sat:
feedsync copy 1/, a full backup made before an update in 2024core~/, another copy of the same old core filesindex~.php,readme~.txtandLICENSE~.txt- a 12 MB zip of processed feed files
I deep scanned all of it. There was no malicious code. The old core contains a routine that takes base64 data from a feed, decodes it and writes it to disk to save listing photos. That's legitimate, but "decode base64 and write a file" is exactly what malware droppers do, so a heuristic scanner flagging it makes sense. The newer release is laid out differently, which explains why only the old copies matched.
The two copies were byte-for-byte identical, which explains why MalCare counted 1 file rather than 2.
Two lessons from this:
- Wordfence didn't see it. By default Wordfence only scans WordPress itself. Folders like
/XML,/old,/backupor/devare skipped unless you turn on "Scan files outside your WordPress installation". MalCare scans everything, so the two tools disagreed. - Leftover copies are a risk even when they're clean. Old code doesn't get security updates, and that backup still held a
config.phpwith a database password in it.
The bigger surprise: the whole pipeline was obsolete
When I checked how the site actually gets its listings, I found something else. The FeedSync Companion plugin was connected to FeedSync's hosted cloud API, not to the local install.
The old setup had been:
CRM → FTP → local FeedSync (/XML) → WP All Import → WordPress
At some point it had been replaced with:
CRM → FeedSync cloud → FeedSync Companion → WordPress
But nobody had switched off the old pipeline. A server cron was still running the local FeedSync every few minutes, and the CRM was still sending files to it by FTP. In 30 days of access logs, nothing read its output. WP All Import was installed but inactive.
So the folder MalCare flagged was a whole piece of infrastructure still doing work that nothing used, on code that hadn't been updated in years.
The clean-up checklist
This is what I recommended to the client:
- Delete the quarantined copies (
feedsync copy 1,core~, the~files and the zip). - Retire the legacy pipeline safely: move the whole
XMLfolder to quarantine for a week, update a test listing in the CRM, and confirm it appears on the site through the cloud sync. - Then remove the cron job, the FTP account and the old FeedSync database, and ask the CRM to stop the FTP export.
- Delete inactive plugins like WP All Import Pro, and the stray
.zipfiles sitting inwp-content/plugins. - Remove dead third-party tags from Google Tag Manager.
- Turn on Wordfence's "scan outside WordPress" option so the next scan covers the whole account.
Key takeaways
- A scanner count without a path isn't a diagnosis. Verify checksums, sniff file types and check the usual hiding spots before you assume a hack.
- Use the scanner as a search tool. Moving folders outside the web root and rescanning finds the flagged file without paying for an upgrade.
- Look outside WordPress. Old apps, backups and
copy 1folders underpublic_htmlare where false positives and real backdoors both tend to live. - When you migrate, decommission. An integration you replaced but never switched off keeps running, and keeps exposing old code to the internet.
Security plugin saying your WordPress site is hacked, and you can't find out why? I do WordPress malware investigation and clean-up for clients worldwide, and I'll tell you honestly whether it's a real infection or a false positive. Tell me what you're seeing and I'll reply within a few hours.
