Replace WordPress Core Files – Advanced Troubleshooting

In Advanced Troubleshooting, Troubleshooting, Troubleshooting, WordPress by Travis BallesteroLeave a Comment

Replacing wordpress core files can resolve many issues with your WordPress site, from a compromised site, wp-admin is not accessible, even the infamous WSOD (White Screen of Death). This task can seem difficult but once it is clear “what is what” when looking at the files, the task becomes very straight forward. So let’s take a look at a standard WordPress site from the web root.

From this view we can see all the core file folders, the database connection file and the wp-content folder, which is where all of user content lives. (Themes, plugins, images, etc.) These are the three main categories of components when talking about WordPress file systems.

PRO TIP! It is always a good idea to disable plugins before removing the old core files.

When replacing core files we want to remove all of the core files keeping only the wp-content folder and the database connection file. (wp-config.php) Let’s see how that stacks up.

Once we deleted all of the core files, we want the newest version of WordPress which can be found here, Latest WordPress, Upload the downloaded file to your web root and extract it. Now we should have something like,

Inside of the WordPress folder is all of your new core files that have to be moved in place of the ones we removed earlier. Move all of the files and folders EXCEPT the wp-content folder to the web root and finally, delete the wordpress folder and it’s contents. Once complete this is complete, your file system should look as it did before we started. Next we have to log into the admin panel and reset permalinks to regenerate your htaccess file. This can be found under Settings>Permalinks in your WordPress dash. For more details on resetting permalinks, check out this article.

PRO TIP Replacing the wp-config.php file is a good idea if the site was compromised. Doing so is as easy as copying the database connection strings into the supplied wp-config-sample.php and renaming it to wp-config.php.

That’s it! You should now have a functioning site if all went well. Time to turn plugins back on and check your links.

 

Leave a Comment