How a malware scan works
A scanner looks for code that should not be there, and it does so in two ways. The first is comparison: your platform’s core files are published, so a scanner can check whether any of them differ from the official version, and an altered core file is a strong signal. The second is pattern matching against known malicious code — obfuscated blocks, functions that fetch and run remote instructions, hidden administrator accounts, spam links written into post content.
Where the scan runs matters. A scanner installed on the site can read every file and the database, but it is running inside the environment it is meant to be judging, so well-hidden code can hide from it too. A remote scanner fetches your pages the way a visitor does and looks for symptoms: injected links, unexpected redirects, or a warning already recorded against your domain. The two answer different questions, and a serious check uses both.
Why malware scanning matters
Most website infections are not designed to break your site. They are designed to use it quietly — to inject spam links about pharmaceuticals or gambling, to redirect visitors arriving from search while leaving the site normal for anyone typing the address directly, or to send email through your server. That is exactly why they go unnoticed: the owner visits the site, sees nothing wrong, and only discovers the problem when traffic collapses.
The consequences arrive from outside. Browsers show interstitial warnings once a site is flagged as unsafe, search engines can record a security issue against it, and email providers begin rejecting messages from a domain associated with spam. Recovering from that costs far more than the cleanup itself, because trust and rankings both have to be rebuilt.
Where malware scans go wrong
The most expensive mistake is cleaning the symptom and stopping. Deleting the injected code without finding how it arrived — an outdated plugin, a stolen password, a compromised shared hosting neighbour — guarantees it comes back, often within days, and each round makes the site messier.
The second is scanning a site that is already compromised and believing a clean result. Malicious code can exclude itself from a plugin’s scan or hide from an administrator while still serving spam to search engine crawlers. Checking what a crawler sees, rather than what your browser sees, catches infections a dashboard scan misses. A third mistake is restoring the most recent backup: if the infection is older than that backup, you have restored it too.
How to act on it
Scan on a schedule rather than after a scare, and pair a plugin scan with an external check and with Search Console’s security reports, which tell you what Google has recorded about the domain. If something is found, take the site offline or into maintenance mode before cleaning, so visitors are not exposed while you work.
Then treat cleaning as a sequence, not a single action: replace core, theme and plugin files with fresh copies from their official sources rather than editing them; remove unknown administrator accounts; change every password and any keys or salts; check scheduled tasks and uploaded files for stray scripts; and only then request a review from the platforms that flagged you. Close the entry point last but do not skip it, and keep website backups old enough to predate an infection. Where a site matters to the business, this belongs in a regular website maintenance routine.
