DD DevDome Track. Protect. Grow.
Security

WordPress Core Files Modified: What It Means and How to Fix It

Core files should never change between releases. When a scan says one did, you either have a careless developer or an attacker. Here is how to tell, and how to put it right.

On this page
  1. How the check works
  2. Innocent causes
  3. Malicious causes
  4. Repair, step by step
  5. Reading a diff when you are not a developer
  6. Then find the cause

When a scan reports WordPress core files modified, it means a file shipped by WordPress itself no longer matches the official copy for your version. WordPress publishes a checksum for every core file in every release, so this is not a heuristic; the file is different. The job is to find out why, then replace the file with the official one. Here is how to read the report, the innocent and malicious explanations, and the repair that does not risk your site.

How the check works

Every WordPress release comes with a list of files and their hashes. A scanner downloads that list for your exact version and locale, hashes each core file on your server and compares. Three outcomes:

  • Match. The file is exactly what WordPress shipped. Clean.
  • Mismatch. The file exists but its content differs. Modified.
  • Unexpected file. A file sits inside a core folder, wp-admin or wp-includes, that is not in the list. Added.

WP-CLI exposes the same check as a single command, and a good scanner runs it automatically and shows the differing lines. Both the mismatch and the unexpected-file cases need attention.

Innocent causes

Not every modification is an attack. Common honest explanations:

A developer edited core. Someone, years ago, fixed a bug directly in a core file instead of in a plugin. It worked until the next update silently overwrote it, or it is still there and the scan found it. Either way it belongs in a plugin, not in core.

Host-injected code. Some hosting platforms add a line to index.php or wp-settings.php for caching, monitoring or their own toolbar. Ask the host; they will tell you which file and why. It is still worth knowing it is there.

An interrupted update. A core update that failed halfway leaves a mix of old and new files. The checksum list for the version WordPress thinks it is running will not match the files from the previous one. Reinstalling core fixes it.

Line ending or encoding changes. A file opened and saved by an editor that converted line endings. Harmless but still a mismatch, and still worth restoring to the official copy.

Malicious causes

Attackers modify core because core loads on every request and nobody reads it. The usual targets:

  • wp-settings.php, wp-load.php, index.php: a single include line that pulls in a backdoor from the uploads folder.
  • wp-includes/ files: especially large ones like class-wp.php or functions.php, where an extra block hides among thousands of lines.
  • wp-admin/ files: code that captures admin passwords as they are typed into the login form.
  • Added files with innocent names: wp-includes/wp-cache.php, wp-admin/css/color.php and similar, which do not exist in WordPress.

The signatures are the same as any backdoor: request input flowing into eval or system, base64 blobs, remote fetches written to disk. A scanner that shows the evidence makes the innocent-versus-malicious call quick. If the differing lines are a cache include from your host, fine. If they are a base64 string, you are cleaning a hack.

Repair, step by step

1. Back up first. Even a clean repair deserves a restore point.

2. Repair official files from official copies. For each modified core file, replace it with the file from the WordPress package for your exact version and locale. DevDome Malware Scanner does this with a one-click repair for eligible core and WordPress.org plugin files, after showing you the differences, and it quarantines rather than deletes anything it moves aside. Scanning, quarantine and eligible repairs need no account. We make it, so weigh that; the principle is to repair from the official source, never by hand-editing.

3. Remove added files. Anything in wp-admin or wp-includes that is not in the checksum list should go, via quarantine so you can restore it if it turns out to be a host’s file.

4. Leave wp-config.php and .htaccess alone, but read them. They are yours, not WordPress’s. Inspect them for lines you did not write: unexpected includes, auto_prepend_file directives, rewrite rules that redirect visitors.

5. Check what the modification pointed at. If a core file included something from uploads or a theme folder, that target is the real payload. Quarantine it.

6. Clear caches and rescan. A clean rescan with every core file matching is your confirmation.

Reading a diff when you are not a developer

A good scanner shows the lines that differ. You do not need to understand PHP to judge them; you need to recognise three shapes. A single added line near the top of the file that includes or requires another file, especially one under wp-content/uploads or with a strange name, is a backdoor loader. A long block of letters and digits with no spaces, often wrapped in a decode function, is obfuscated code and almost never legitimate in core. A short, readable comment and a line or two mentioning cache, your host’s name or a monitoring agent is a host injection; confirm with the host and move on. Anything you cannot place after that goes to quarantine, which is reversible, rather than being left in place.

Then find the cause

If the cause was a developer or the host, make a note and move on. If it was an attack, the modified core file is a symptom; something let the attacker write to disk. Update everything, change every password, check for rogue admin users and scheduled tasks, and look through the activity log for the login or upload that started it. Schedule a weekly scan so that the next modification, if there is one, is caught in days.

Core files should be boring. When the scan says they are not, treat it as the clearest evidence you will get and act on it the same day.

Related reading: WP Activity Log Alternative: A Local Audit Trail Without the Upsell.

Disclosure: DevDome publishes this blog and makes the products it mentions. We describe what they do rather than promise results.

Key takeaways

  • Every WordPress release publishes checksums for its files. A core file that does not match is a fact, not a guess.
  • Innocent causes exist: a developer hack, a host-injected line, an interrupted update. They still need fixing, because the next update overwrites them anyway.
  • Malicious modifications usually hide in files that load on every request: wp-settings.php, wp-load.php, index.php, and the wp-includes tree.
  • Repair means replacing the modified file with the official copy for your exact version and locale. Never edit it by hand.
  • Extra files inside core folders are as suspicious as modified ones. The checksum list also tells you what should not be there.

Sources

  1. WordPress.org API: core checksums : the official per-file checksums for a release
  2. WP-CLI: wp core verify-checksums : the command-line way to run the same check
  3. WordPress.org: FAQ My site was hacked : official recovery guidance when modifications are malicious

Links last checked October 17, 2026.

Frequently asked questions

Can a plugin modify core files?

It should not, and well-behaved plugins never do. Some badly written ones and some hosting panels inject code into wp-config.php or index.php. A scanner that verifies against WordPress.org catches that, and the fix is the same: restore the official file and ask the vendor why.

Will repairing core files break my site?

Not if you repair to the same version you are running. The official file for your version is byte-for-byte what WordPress installed in the first place. The exception is wp-config.php, which is yours and is not in the checksum list; never overwrite it.

What about wp-config.php and .htaccess?

They are not core files in the checksum sense; they are your configuration. A scanner inspects them for suspicious directives rather than comparing them with an official copy. Review changes there by hand.

Should I just reinstall WordPress?

Reinstalling core from the Updates screen replaces every core file with the official copy and is a reasonable blunt fix. It does not remove extra files that were added, and it does not touch plugins, themes, uploads or the database, where the infection may also live.

DevDome Team WordPress plugin builders

The DevDome team builds lightweight, performance-first WordPress plugins and free tools for site owners, founders and marketers. We write about the exact problems our plugins solve, in plain language for people who run real sites.