In this article, I will discuss how to replace WordPress core files. However, before we can discuss this, there are two questions we need to answer: 1> What are WordPress core files? 2> When and why should we replace them?
What are WordPress Core files?
Core files are what constitute WordPress. these are the files that enable all the features of WordPress. These files are what you get when you install or download WordPress from wordpress.org. These include the folders : wp-admin and wp-includes, and all the files in the root, except wp-config.php. Although the wp-content folder and the wp-config.php file are system generated, their contents are based on user inputs. So they fall under the category of user generated content.
When and why should we replace WordPress Core files?There are two main scenarios when we replace WordPress Core files:
- When it is not possible to automatically update WordPress.
- When the core files have become corrupted due to hacking/malware attack or some other reasons.
Now that we have covered what the core files are, and when to replace them, let’s address the primary topic of this post:
How to replace the WordPress Core files?
To update the core files, please follow these steps:
- Download WordPress from wordpress.org and extract it on your PC.
- Using either file manager or FTP, open your site’s file system.
- In the site’s root, delete these folders: wp-admin and wp-includes. Leave wp-content as it is.
- Delete all the files in the root, except wp-config.php
- From the download extracted on your PC, upload wp-admin, wp-includes and wp-config.php to the root of your site.
Now you have a fresh WordPress core!