Recently, we got a mail where one of our users asked how to reinstall WordPress? While using WordPress, sometimes you may face issues due to corrupt files. To solve this problem, you need to reinstall the WordPress file making sure that the existing files are not lost. On the other hand, if you want to start from the beginning, you can reinstall the fresh copy of WordPress.
Depending on your requirement, you may either want to reinstall and start a new site or only want to reinstall core WordPress files to prevent losing the site content. You should always remember to take a backup of the site before you reinstall WordPress so that it will be useful in case if you need to restore the site to the earlier state.
There may be different reasons for you to make a decision to reinstall WordPress.
There are different methods to reinstall WordPress. Let’s have a look at them one by one.
This is the recommended method to reinstall WordPress if you have access to the admin dashboard. If you use this method, then all your site contents will not be lost.
When you are in the dashboard, Go to Dashboard > Updates and you will find the option to reinstall.
After you click Re-install, then you need to wait for some time as it will be working for the changes. During this period, the site will be unavailable shortly. This is an automatic process so there is nothing to worry about.
However, if you do not have access to the dashboard, you can also do it manually from other methods listed below.
WP-CLI can be used to add or remove different categories, posts as well as users. In addition, you can insert or replace test data and search from the database. CLI is the tool that can be used to add the commands in order to customize the WordPress installation. This is supported by major WordPress hosting companies and you can use it to reinstall WordPress without changing the current state of themes and plugins.
wp core download --skip-content --force
This method is recommended if you do not have access to the admin dashboard. This is a manual method to reinstall WordPress. If you are familiar with FTP, you can access the site contents through it.
First of all, you need to download the latest version of WordPress from wordpress.org. You need to extract the contents from the zip version of WordPress. Delete the wp-content folder after extraction.
Why do you need to delete the wp-content folder?
It is done to prevent overwriting the content.
With FTP credentials, you can upload the remaining files to the WordPress installation directory. Usually, the root folder will be named as public or public_html in most of the hosting providers. While uploading, you will need to replace the existing files that are present in that location.
This process replaces core files with a fresh copy of WordPress. As we have previously deleted the wp-content folder, the content related files like themes and plugins remain the same.
If you no longer want to save existing files like themes, plugins, and other contents present in your site, this method is recommended to you. You will not be able to recover the site once you delete all the content.
To continue with this process, you need to perform two steps:
If you have access to the admin dashboard, you can delete the files from the WordPress dashboard. However, you may also use FTP in case if you do not have access to the dashboard.
You can further delete the database from the phpMyAdmin if you want a completely new start. Deleting the database will remove each and every data associated with your site.
Likewise, you can install the latest version of WordPress in the root directory.
Conclusion
If you followed the things mentioned in this post, then you already know how to reinstall WordPress. It’s an easy process that can be done automatically from the dashboard or manually with the help of FTP, WP-CLI, etc.
Furthermore, you can delete the database in the process of removing the site if you want a fresh new start.
Hopefully, this post was useful to describe the topic. If you have any confusion, feel free to leave the comment below.
Further Reading
As a visitor of the site and website owner, it is awful to experience errors on the site. Error pages… Read More
In the present context, every business owner maintains their own site for the online presence. When something unexpected happens with… Read More
If there are too many images on your site, they are uploaded in either PNG or JPG format. Learning how… Read More