How to check WordPress for a virus
You can do a first check yourself:
- Scan from the outside with a free online scanner such as Sucuri SiteCheck. It shows what visitors and Google see.
- Scan the files with a security plugin such as Wordfence, and compare core files with
wp core verify-checksumsif you have SSH. - Test on a phone. Some infections only show on mobile, so a redirect or pop-up that never appears on your desktop can still be there.
- Look for odd files, especially
.icoor image files in strange folders that are actually PHP code, a classic hiding trick.
A clean result doesn’t prove the site is clean, but a positive one tells you it’s time to act. My guide on how to scan a WordPress site for malware goes deeper.
“Virus” vs malware: does it matter?
Not really. Strictly speaking, a virus is a program that copies itself, and most WordPress infections are better described as malware: malicious code added to your site to make money for an attacker. But plenty of WordPress infections do spread like a virus. They copy themselves into every theme, every plugin, or every site in your hosting account. Whatever you call it, the cleanup needs to find every copy.
What a WordPress trojan is
A trojan is malicious code that hides inside something that looks useful or legitimate. On WordPress sites, the usual disguises are:
- Nulled themes and plugins: pirated premium products with a backdoor added before they were shared.
- Fake plugins with names like “WP Security Patch” or “Cache Helper”, sometimes hidden from the plugin list.
- Fake core files with names that look like WordPress, such as
wp-tmp.php,wp-login1.phporclass-wp-cache.php, placed where real WordPress files never are. - Code added to real files. A few lines at the top of a genuine plugin file or your theme’s
functions.php.
A well-known example is the “WP-VCD” malware family, which spread through nulled themes. It created a hidden admin account, then infected every other theme on the site and other sites on the same server. Deleting the theme it arrived in did nothing; the copies stayed behind.
Why a WordPress virus keeps coming back
When owners tell me “I removed it and it came back”, it’s almost always one of these:
- A backdoor was missed. The visible malware was removed, but a small hidden file that lets the attacker upload it again is still there.
- Something reinstalls it. A hosting cron job, a “must-use” plugin, or a function hooked into WordPress that rewrites the infected files every few hours.
- Another site in the account is infected. It reinfects yours through the shared file system.
- The entry point is still open: the vulnerable plugin, the nulled theme, or the leaked password.
How I remove a WordPress virus or trojan
- Map the infection. Which files, which sites in the account, which database records, and which user accounts are involved.
- Replace instead of patch. WordPress core, plugins and themes are reinstalled from clean, genuine sources. Nulled software is removed.
- Remove the backdoors and persistence: hidden files, fake plugins, unauthorized admins, cron jobs, and
.htaccessorphp.initricks. - Check neighboring sites in the same hosting account, so the cleanup actually holds.
- Close the entry point and harden the site: updates, passwords, security keys, and safer file permissions.
- Verify and report. You get a plain-language summary of what was found and what changed.
A typical case: a designer’s hosting account holds six client sites, and the host keeps flagging new “trojan” files every few days. The source turns out to be a nulled premium theme installed on one site a year earlier. Its backdoor had added hidden admin accounts and copied itself into the themes of four of the other sites. Cleaning sites one at a time had never worked, because the clean ones were reinfected by the dirty ones. Cleaning all of them together, replacing the nulled theme with a licensed copy, and rotating every password finally ended it.
Do you need antivirus for WordPress?
Not in the desktop sense. What protects a WordPress site is a combination of habits and tools: keep everything updated, use only genuine plugins and themes, use strong unique passwords with two-factor login, keep regular off-site backups, and run a security plugin for monitoring. My guide to WordPress malware scanners explains what those scanners can and can’t catch.
If your site is already infected, have a look at the full malware removal service, or contact me with what you’re seeing.