If your WordPress website is displaying strange errors, white screens, or you’re suspecting that a few core files may be corrupted or modified due to malware or a failed update a fresh reinstallation of WordPress core files can often fix the issue.
The good news? You can reinstall WordPress safely from cPanel without losing any of your content, themes, plugins, or settings.
This article will walk you step-by-step through the process, even if you can’t access your WordPress dashboard.
When Should You Reinstall WordPress Core Files?
Consider a reinstallation if:
-
Your site shows: “There has been a critical error on this website”
-
You get 500 internal server errors with no obvious cause
-
Core files have been tampered with by malware
-
Automatic updates failed or were incomplete
-
You accidentally deleted some core files
This process replaces only the WordPress core files such as wp-admin
and wp-includes
while keeping your content (posts, pages), themes, plugins, media, and database safe.
How to Reinstall WordPress Core Files via cPanel (Safely)
Step 1: Log into Your cPanel Account
Access cPanel by visiting:
Use the login details provided by your hosting provider.
Step 2: Create a Full Backup (Optional but Recommended)
Before making any changes, always back up your site:
-
Go to cPanel > Backup Wizard
-
Select Full Backup or download files and database manually
This ensures you can recover your site if something goes wrong during reinstallation.
Step 3: Download the Latest WordPress Zip File
-
Click Download WordPress to get the latest
.zip
file -
Save it on your computer
Step 4: Open File Manager in cPanel
-
Navigate to Files > File Manager
-
Open the public_html/ folder or the folder where your WordPress is installed
Important: Do not delete the
wp-content
folder or thewp-config.php
file these contain your content and settings.
Step 5: Upload and Extract the WordPress Zip File
-
In
public_html/
, click Upload and select the downloaded WordPress ZIP -
Once uploaded, right-click on it and select Extract
-
It will create a new folder named wordpress/ open this folder
Now you’ll see:
-
wp-admin/
-
wp-includes/
-
All core files like
index.php
,wp-settings.php
, etc.
Step 6: Copy Core Files to the Root Directory
We need to move only the core files, not your content or config.
-
Open the
wordpress/
folder -
Select everything except the
wp-content/
folder andwp-config.php
file -
Click Move or Copy
-
Set the destination to your root directory (e.g.,
/public_html/
) -
If asked to overwrite files, click Yes
This step replaces any corrupted or missing core files with fresh copies.
Step 7: Clean Up
After copying:
-
Delete the
wordpress/
folder -
Delete the uploaded
.zip
file -
Ensure your site’s root directory still contains:
-
wp-content/
(your plugins, themes, uploads) -
wp-config.php
(your database settings) -
The freshly copied core files
-
Step 8: Test Your Website
Visit your website in a browser:
-
If the issue was related to core file corruption, your site should now be restored
-
Log into wp-admin to confirm admin access works
If the issue persists, check
error_log
inside cPanel’s File Manager or use phpMyAdmin to confirm your database is intact.
What This Method Doesn’t Touch
-
Database: Your posts, pages, and settings remain untouched
-
wp-content/: Your media, plugins, themes remain safe
-
Custom settings in
wp-config.php
: Like memory limits or cache keys
It’s a clean way to refresh only what WordPress originally ships with.
Conclusion
Reinstalling WordPress manually via cPanel may sound technical, but it’s a safe, straightforward way to fix issues when core files become corrupted. This approach keeps your content, media, plugins, and database intact making it ideal when you want to fix the system without starting over.
If you’re unsure about handling the files, don’t hesitate to reach out to our hosting support team for assistance.