Replacing WordPress Core Files

Identifying the Problem

You may encounter an issue where your website loads an error instead of your site content, or sometimes even just a blank screen. If the error (on the site itself or in the error_log) points to a plugin or theme, this will need to be disabled and you should be able to access WordPress again. This guide walks you through how to find the error_log file and how to disable a plugin/theme through the file manager.

If the error involves a file outside of the wp-content folder (such as within the wp-admin folder, wp-includes folder, or main installation files), then this is most likely a sign that the WordPress core files need to be replaced.

Here is an example of a core files error:

Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /home/katietem/public_html/wp-includes/Requests/Cookie.php on line 119

Fixing the specific problem described may fix that error, but oftentimes a new error pops up in its place. So, that is why it is best to go ahead and replace all the core files.

Check What Version You Have Installed

Before getting a clean copy of the WordPress files, you will need to know what version of WordPress your site is running.

Go to your application in Installatron (cPanel > "My Apps"), and you will see the version number below the links to access your site.



Download the WordPress Files

Download a clean copy of the files from WordPress.org. The latest version will be here on their download page, while all past versions will be located here.

Upload Files Using FTP

If you are new to FTP, here is a guide all about what it is and how to use it.

Open an SFTP connection to your account using an FTP client and navigate to the folder of the WordPress installation. For this example, I will be using CyberDuck.

Extract the files from the compressed file. Select everything except the wp-content folder and the wp-config.php file (usually wp-config is not included anyways, just wp-config-sample.php, but I leave that out as well just to be sure) and move it over to the folder open in your FTP client.

The wp-content folder is where all content including themes, plugins, and uploads are stored and the wp-config.php file has your specific database credentials stored, so you don’t want to replace these.

When uploading, you will most likely get a warning that files with those same names already exist. Double-check here that the wp-config.php file and wp-content folder are not included here and continue with the overwrite.

Once that finishes uploading, your core files have been replaced!