How to Troubleshoot and Repair WordPress Core Files
Running a WordPress website can be tricky, especially when you encounter problems. One common issue is corrupting or missing core file errors. So, what are these core files, and why do they matter? They're crucial for keeping your site running smoothly!
- What Are WordPress Core Files?
- Why Shouldn't You Modify Core Files?
- Where Can You Find WordPress Core Files?
- Signs of WordPress Core File Issues
- Prepare Before Troubleshooting
- How to Troubleshoot Core File Errors
- How to Repair WordPress Core Files
- Frequently Asked Questions
- Summary
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
wp-settings.php
-/wp-includes/
/wp-admin/
These files handle how WordPress operates and are part of every WordPress installation. You should not modify them manually unless you know exactly what you're doing.
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. Alternatively, consider options that suit your needs: What is WP-Content Uploads and How to Upload Files in WordPress.
Where Can You Find WordPress Core Files?
To locate them:
- Log in to your hosting account's File Manager or access your site via FTP.
- Navigate to the root directory (usually.
/public_html/
). - Look for files like
/wp-config.php
: Connects the WordPress installation to the desired database/wp-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 core WordPress code.
You can also access the WordPress core files directly from the official WordPress repository on wordpress.org. This is particularly useful for downloading the latest version of WordPress or specific releases for installation or development purposes.
Signs of WordPress Core File Issues
You might be dealing with corrupted or missing core files if you notice:
- White screen of death (blank screen)
- "There has been a critical error" message
- 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: Getting CodeGuard Set Up for Backups or How to Backup My WordPress Website.
Also:
- Check the "Compatibility" of your site against new versions of PHP before upgrading. Sites built with WordPress can use the PHP Compatibility Checker plugin. 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 or via File Manager or FTP if you cannot access your WordPress dashboard.
How to Troubleshoot Core File Errors
- 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.
Note: These errors frequently refer to files in the wp-admin or wp-includes folders.
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.
- Disable the WP DEBUG from true to false in the wp-config.php file to disable WordPress debug mode.
How to Repair WordPress Core Files
WordPress website administrators can check the status of their WP installation and see if there are any pending version updates for the application core or any associated add-ons by going 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, WP 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.
- Option 1: Scan and Repair Using Bluehost
- Option 2: Update WordPress via Admin Panel
- Option 3: Manually Replace Core Files
Option 1: Scan and Repair Using Bluehost
- Log in to your Bluehost Account Manager.
- There are two ways to scan and repair core files in the Account Manager:
- Websites Tab: Click the Websites tab in the main navigation menu.
- If you have a single website in your account, you'll be redirected to the website management page immediately.
- If you have multiple websites in your account, locate the website you need to manage and click its Settings button.
- Hosting Tab: Click the Hosting tab in the main navigation menu.
- If you have a single hosting package in your account, you'll be redirected to the website management page immediately.
- If you have multiple hosting packages in your account, locate the hosting package you want to manage on the Hosting Packages page, then click its Manage button.
Next, find the website you need to manage and click its Settings button.
- Websites Tab: Click the Websites tab in the main navigation menu.
- Go to the Security tab.
- Scroll to the Check Core WordPress Files tile and click Scan Core Files to scan and repair core files.
- If no issue is found, you will see a pop-up: "Your WordPress core files for example.com have been scanned and no modifications have been detected."
- If issues are found, select Repair.
Option 2: Update WordPress via Admin Panel
If your dashboard is accessible:
- Log in to the WordPress Admin Dashboard.
- Go to Dashboard > Updates.
- Click Re-install version x.x. This replaces all core files without affecting your content.
- Wait for the update to complete.
Option 3: Manually Replace Core Files
Important: Do NOT delete wp-content/
or wp-config.php
.
- 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 root (except
wp-content
andwp-config.php
)
- Overwrite when prompted.
Frequently Asked Questions
- Will this affect my posts or images?
No, as long as you don't deletewp-content/
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
WordPress core file errors can break your site but are usually fixable. Follow this guide to safely diagnose and repair issues using tools built into Bluehost or manually restore files. And always back up before you start!
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.