How to Troubleshoot and Repair WordPress Core Files
Running a WordPress website can be tricky, especially when you encounter problems. One common issue is a corrupt or missing WordPress core file. So, what are these core files, and why do they matter?
In this article, we will discuss the following topics.
What are WordPress Core Files?
WordPress core files are the essential files that make your WordPress site run. These include PHP files and directories like:
- wp-config.php (file)
- wp-settings.php (file)
- wp-includes (folder)
- wp-admin (folder)
These files control how WordPress functions and are found in every WordPress installation. You should avoid modifying them manually unless you fully understand the implications.
Why Shouldn't You Modify Core Files?
Modifying core files can:
- Data Integrity Issues: Changes can disrupt the platform's functionality and complicate troubleshooting.
- Legal Concerns: Unauthorized modifications may violate licensing agreements and ethical guidelines.
- Loss of Evidence: Core files are crucial for diagnosing errors; changes can erase vital information needed for effective troubleshooting.
- Available Debugging Tools: Use logging plugins and error reporting features instead of altering core files.
- Risk of Further Damage: Making changes without proper knowledge can introduce more problems.
Always use plugins, themes, or the functions.php file for customizations.
Where to Find the WordPress Core Files?
To locate your WordPress core files:
- Navigate to your site's document root via the File Manager or FTP.
- Look for files like:
wp-config.php: Connects the WordPress installation to the desired databasewp-admin: Contains the files and resources required for the WordPress admin dashboard.wp-includes: Contains core WordPress files such as libraries, functions, and classes.wp-content: While not strictly part of the core WordPress files, this directory contains user-generated content, such as themes, plugins, and uploaded media. It's an essential directory for WordPress functionality, but doesn't include the core WordPress code.
Signs of WordPress Core File Issues
You might be dealing with corrupted or missing core files if you notice the following:
- White screen of death (blank screen)
- "There has been a critical error" page
- WordPress login issues
- Broken layout or missing pages
- Site redirects to strange URLs
- 500 internal server errors
Prepare Before Troubleshooting
Before making any changes, always back up your website:
- Use Bluehost's backup tools or plugins like UpdraftPlus.
- Save both your website files and database. To learn more about this process, please follow either of these guides for backing up your website: Setting Up CodeGuard for Backups.
Also:
- Check the "Compatibility" of your site against new versions of PHP before upgrading. Sites built with WordPress can use the Plugin Compatibility Checker. The minimum PHP version on our Shared hosting servers is 8.1. You can also check the PHP Manual to review PHP's new and deprecated features.
- Deactivate all plugins temporarily. You can turn off plugins in the database, File Manager, or FTP if you cannot access your WordPress dashboard.
How to Troubleshoot Core File Errors
WordPress site administrators can verify the status of their WordPress installation and check for any available updates for the main application or any related plugins by navigating to /wp-admin/update-core.php.
Most users can use WordPress's built-in auto-update capabilities to install the most recent stable version with a single click. In such cases, WordPress will enter Maintenance mode automatically, download and apply the core updates in the background, and then confirm the process's success. However, if WordPress is misconfigured or transferred with incorrect file permissions, the auto-update functionality may fail, and the website may become stuck in Maintenance mode.
- Enable the WordPress debug mode.
- Open the website again to generate the error, then check the results.
- Examine your website to see if there is a PHP error. If there is a PHP error, see if the file path contains a reference to a WordPress core file or folder. These errors frequently refer to files in the wp-admin or wp-includes folders.
For example:
Fatal error: require(): Failed opening required '/home/user/public_html/wp-includes/class-wp.php'- If the error's file path contains a reference to a core file or folder, you can proceed to resolve the problem.
- If the error is not visible on your website, view the error logs.
- If you see a PHP error related to a core file in the logs or detailed errors, you can start fixing it.
- If you see a PHP error related to a core file in the logs or detailed errors, you can start fixing it.
- If the error's file path contains a reference to a core file or folder, you can proceed to resolve the problem.
- Once fixed, disable the debug mode from "true" to "false" in the wp-config.php file.
How to Repair WordPress Core Files
There are several ways to repair your WordPress core files.
Option 1: Repair Core Files through the Account Manager
- Log in to your Bluehost Account Manager.
- In the left-hand menu, click Websites.
- Click the MANAGE button located next to the website you want to manage.

- Click the Security tab.

- In the Check Core WordPress Files card, click the SCAN CORE FILES button.

- The system will scan your site's core files.
- If no issues are detected, a prompt will appear at the top, stating that no modification was detected.

- If issues are found, the prompt will indicate that there is a problem.

To resolve this, click on REPAIR CORE FILES. This action will replace your current core files with new ones.

- If no issues are detected, a prompt will appear at the top, stating that no modification was detected.
- To verify, perform a quick re-scan. The system will no longer find any issues with your core files. You will also receive a notification that the core files have been restored to their original state.

Option 2: Repair Core Files from the WordPress Dashboard
To repair your site's core files through the WordPress dashboard, update your WordPress version. Updating WordPress will refresh or replace your site's core files.
- Log in to your Bluehost Account Manager.
- In the left-hand menu, click Websites.
- Click the WORDPRESS ADMIN button located next to the website you want to manage.

- In the WordPress dashboard, click Dashboard in the left menu, then select Updates.

- Click Re-install version x.x. This replaces all core files without affecting your site's actual content or settings.

- Wait for the update to complete.

Option 3: Manually Replace Core Files
- Download the latest WordPress version from wordpress.org.
- Extract the ZIP file on your computer.
- Using FTP or File Manager, upload the following to your site's root directory:
/wp-admin//wp-includes/- All files in the document root (except for the
wp-contentandwp-config.php)
- Overwrite when prompted.
Frequently Asked Questions
- Will this affect my posts or images?
No, as long as you don't delete the wp-content folder or the database.
- How do I know if the issue is a plugin instead?
Deactivate all plugins and check if the issue is resolved. If it does, reactivate them one by one.
- What if I can't access the dashboard at all?
Use FTP or File Manager to manually update or restore a backup.
Summary
Errors in WordPress core files can disrupt your site, but they are often fixable. This guide will help you safely diagnose and repair these issues using the tools available in the Bluehost Account Manager, through the WordPress dashboard, or by manually repairing the core files. Remember to always back up your site before you begin!
If you need further assistance, feel free to contact us via Chat or Phone:
- Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
- Phone Support -
- US: 888-401-4678
- International: +1 801-765-9400
You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.