Replace 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 files, the database connection file and the wp-content folder, which is where all of user content lives. (Themes, plugins, images, etc.)
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. Move all of the files EXCEPT the wp-content folder to the web root and finally, delete the wordpress folder and it’s contents. Once complete, log into the admin panel and reset permalinks to regenerate your htaccess file.
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.