In this guide
How to tell if a file belongs to WordPress
You don’t need to memorize file names. These checks give you a reliable answer:
- Core files: compare with the official checksums. With SSH,
wp core verify-checksumslists every core file that’s been changed, and every file inwp-admin,wp-includesor the root folder that “should not exist”. Anything extra there is almost certainly malware. - WordPress.org plugins: compare too.
wp plugin verify-checksums --alldoes the same for plugins from the official directory. - Premium plugins and themes: compare with a fresh copy. Download the same version from the vendor and compare the folders (
diff -r). - Check the location. PHP files don’t belong in
wp-content/uploads(except anindex.phpthat only says “Silence is golden”). Files with image or icon extensions (.ico,.png) that contain PHP code are a classic disguise. - Look inside. Malware usually has long encoded strings,
eval(,base64_decode(,gzinflate(,str_rot13(, variable names like$O00O0O, or code that runs whatever arrives in a cookie or POST field.
File names that are usually malware
These are names I and other security researchers come across repeatedly on infected sites. A match doesn’t replace the checks above, but it’s a strong hint:
| File | What it usually is |
|---|---|
wp-vcd.php, wp-tmp.php, class.theme-modules.php |
The WP-VCD malware family, usually from nulled (pirated) themes or plugins. See WP-VCD malware removal |
wp-crons.php |
Not a WordPress file. The real file is wp-cron.php; the extra “s” is a disguise |
class-wp-cache.php, wp-cache.php in odd places |
Fake “cache” files are a common backdoor disguise. Not part of WordPress core |
wp-slave.php, wp-console.php, wp-res.php |
Not WordPress core files. Treat as backdoors unless a plugin you use clearly owns them |
lang.php inside wp-content/languages/img/ |
Not a WordPress location for PHP. Commonly a backdoor |
PHP files with random names (ks8dj2.php, x1z.php) in the root or uploads |
Almost always malware |
.ico or image files containing PHP code, often loaded with @include |
A loader for malware, a well-known trick |
Legitimate files that often get suspected
| File | What it is |
|---|---|
wp-admin/admin-ajax.php |
A core WordPress file. Scanners and logs mention it because attacks target it, not because it’s malicious |
wp-includes/sodium_compat/… (e.g. namespaced.php) |
Part of WordPress core (a cryptography library). Verify with checksums, but it belongs there |
wp-includes/js/wp-emoji-release.min.js |
A core WordPress script for emoji support |
wp-content/advanced-cache.php, object-cache.php |
Created by caching plugins. Legitimate if your cache plugin made them, but also a known hiding place, so check the content |
.htaccess files in plugin, cache or backup folders |
Often added by legitimate plugins to protect their folders. Hundreds of identical copies in every folder, however, is malware (.htaccess malware) |
Admin-ajax requests with _fs_blog_admin |
A parameter used by the Freemius framework that many plugins include. On its own, not malware |
Modified legitimate files
The trickiest case is a real WordPress file that’s been changed, such as index.php, wp-config.php, wp-blog-header.php, wp-load.php, wp-settings.php or wp-includes/formatting.php with extra code at the top or bottom. The name is fine; the content isn’t. Checksums catch core files. For wp-config.php, which has no checksum, open it and compare with what a normal one looks like: mostly simple define(...) lines.
From my cleanup work: the files that fool owners most are the ones with the most boring names. Nobody questions wp-includes/class-wp-cache.php or a .ico file in the theme folder. Which is exactly why attackers use them. When in doubt, the checksum command and a comparison with a clean copy are faster and more reliable than any list of names.
Found malware? What next
Deleting one file rarely ends an infection. There are usually backdoors elsewhere and a way in that’s still open. Follow my step-by-step guide to fixing a hacked WordPress site, or send me the file name and location and I’ll tell you what it is.