Attackers like to hide code where nobody looks. A few lines added to a core file in wp-includes, or a small PHP file with an innocent name in wp-admin, can give them a permanent way back into a site. These changes rarely show on the front end.
Fortunately, WordPress core has a useful property: for a given version and language, its files are the same everywhere. That makes it possible to check WordPress core file integrity precisely, by comparing your files with a reference published by WordPress.org.
What counts as WordPress core
WordPress core is everything that comes in the official download package:
- the files in the root folder, such as
index.php,wp-login.phpandwp-settings.php; - the
wp-adminfolder; - the
wp-includesfolder.
Your own content lives elsewhere. The wp-content folder holds themes, plugins and uploads, and it changes constantly, so it is not part of the core comparison. The same applies to wp-config.php, which is created during installation and is unique to your site, and to .htaccess.
The rule is simple: apart from a WordPress update, core files should never change. If one does, something or someone modified it.
How the WordPress.org checksums work
For each release, WordPress.org publishes a checksum for every core file. A checksum is a short fingerprint calculated from a file's contents. Change a single character in the file and the fingerprint changes completely.
The checksums are available through the official API, for a given version and locale, for example:
https://api.wordpress.org/core/checksums/1.0/?version=6.4.3&locale=en_US
An integrity check downloads the list for your exact version, calculates the fingerprint of each file on your server and compares the two. Any difference means the file is not the one WordPress.org shipped.
Running the check with WP-CLI
WP-CLI, the official command-line tool for WordPress, has the check built in. Connect to your server over SSH, go to the WordPress folder and run:
wp core verify-checksums
If everything matches, WP-CLI confirms that the installation verifies against the checksums. Otherwise, it lists warnings for each file that does not match and for files that should not exist in core folders.
If your site uses a translated version of WordPress or you want to check against a specific release, you can say so explicitly:
wp core verify-checksums --version=6.4.3 --locale=de_CH
For plugins hosted on WordPress.org, a similar command exists:
wp plugin verify-checksums --all
It only works for plugins published in the WordPress.org directory. Premium plugins and custom code cannot be checked this way, because WordPress.org has no reference for them.
Reading the results correctly
Not every warning means a break-in, but each one deserves an explanation.
Modified core files
A core file that does not match its checksum should be treated as suspicious until proven otherwise. Innocent explanations exist, such as a developer who "quickly fixed" something in core or an update that was interrupted halfway, but both are worth correcting anyway.
Files that should not exist
An unknown PHP file in wp-admin or wp-includes is a strong warning sign. Attackers often give backdoors names that look plausible next to the real files. Before deleting anything, note the file name and date, and look at its contents: it can tell you when the break-in happened and help you choose a clean backup.
Leftovers from older WordPress versions can also appear here, especially on sites that have been updated manually over many years. Compare with the list of files in the current release before deciding.
False alarms from version or language mismatches
If the check compares your files with the wrong version or locale, many files will appear modified at once. Make sure the version and language match what is really installed.
Repairing modified or unknown files
The cleanest fix is to replace core with a fresh copy of the same version. From the dashboard, go to Dashboard → Updates and use "Re-install version". With WP-CLI:
wp core download --skip-content --force
This overwrites the core files without touching wp-content. It does not remove extra files, so delete unknown files in wp-admin and wp-includes separately once you have recorded them.
Then run the check again. If modified files keep coming back, the attacker still has a way in, often through a plugin, a theme or a stolen password. Follow our checklist for a hacked WordPress site and restore a backup from before the first change if needed.
What a core check cannot see
A core integrity check is precise, but its scope is limited:
- it does not look at
wp-content, where most themes, plugins and uploads live; - it does not inspect
wp-config.phpor.htaccess; - it does not see changes in the database, such as injected scripts or new administrators.
Combine it with other signals: watching for new users and plugin installations, checking for known vulnerabilities, and making sure that only the people you trust can log in, as described in our guide on how to secure your WordPress login.
Make it a routine, not a one-off
Checking once after a scare is good. Checking every day is better, because a change spotted the morning after it happened is far easier to deal with than one discovered months later. Schedule the command with cron if you have server access, and make sure someone actually reads the result.