Reinstalling WordPress Core Files with WP-CLI (Firstserv Guide)
This guide explains how to safely reinstall the WordPress core files using WP-CLI. This can help resolve issues caused by corrupted or missing core files without affecting your content.
Prerequisites
Before you begin:
- ✅ It is strongly recommended to back up your website
- ✅ Ensure you have SSH access enabled on your hosting account
- (Available on most Firstserv plans)
Step-by-Step Instructions
1. Access Terminal / SSH
Connect to your server using one of the following:
- cPanel → Terminal
- An SSH client (e.g. PuTTY or Terminal)
2. Navigate to Your WordPress Directory
Move to your WordPress installation directory, usually:
(Adjust the path if your site is installed in a subdirectory.)
3. Confirm You’re in the Correct Directory
Check that the directory contains your WordPress files by looking for wp-config.php:
You should see files such as:
wp-config.phpwp-content/wp-admin/
4. Reinstall WordPress Core Files
Run the following command:
✅ This will:
- Download fresh WordPress core files
- Replace existing core files
⚠️ It will not modify:
- Your
wp-config.phpfile - Your
wp-contentfolder (themes, plugins, uploads)
5. Clear Cache (Optional)
If you're using LiteSpeed Cache, clear the cache to ensure changes take effect:
6. Verify Your Website
- Visit your website and admin area
- Confirm that everything is working correctly
7. Update Database (If Prompted)
If WordPress indicates a database update is required, run:
When to Use This Method
Reinstalling WordPress core files is useful when:
- Core files are corrupted or missing
- You encounter unexplained errors
- Updates have failed or caused issues
Summary
Using WP-CLI to reinstall WordPress:
- Refreshes core files safely
- Preserves your content and configuration
- Helps resolve common issues quickly
If you need help accessing SSH or running WP-CLI commands, the Firstserv support team is always available to assist.
