WordPress Management

Replacing WordPress Core Files

By Admin November 28, 2025

If your WordPress site has corrupted files or has been compromised, replacing the core files is often the quickest fix. This guide shows you how to do it safely using WP-CLI via SSH.

Step 1 Check Current Version

You need to check the current WordPress Core version so you know exactly which version to download. Run the following command:

Terminal
wp core version

Step 2 Download & Force Replace

Once the version is identified (e.g., 6.8.3), run the command below. Crucial: Ensure you include the --skip-content flag to protect your uploads.

Terminal
wp core download --version=6.8.3 --skip-content --force

What this command does:

  • --version=6.8.3 Downloads that specific release version.
  • --skip-content Keeps your wp-content folder safe. Your themes, plugins, and uploads are not touched.
  • --force Overwrites the core files (wp-admin, wp-includes, root files) to replace any corrupt or missing ones.
Guide verified by Admin