How to Uninstall and Reinstall WordPress for Troubleshooting
Reinstalling WordPress can be a big step to take when you face an issue with your website. If you think of updating, WordPress has a built-in option to do so.
If you get an error, there are many troubleshooting techniques you should use. At last, if you wish to have the fresh installation without losing the data of your site, only then you should think to uninstall and reinstall WordPress.
Sometimes when your website gets hacked, you may need to take some serious steps and make sure the SEO score of your site remains intact.
During the process of WordPress reinstallation, you have to keep the data safe. So, it's vital that youback up the website and its database using cPanel or any plugin.
Many people keep the backup in their web hosting account, which is of no use because if your account gets hacked, it means your backup files also get affected. So, it's necessary to save it on your computer, Google Drive, Dropbox, or anywhere else you like.
In this tutorial, I am going to walk you through a step by step process to delete all the WordPress data, saving the necessary folder, creating a new database, and having a fresh WordPress installation.
1). Export Your Website's Content
This is the first step you need to take to secure the content of your website. This process doesn't include plugins' data; it only contains the content.
Let me show you how you can do this:
Log into your WordPress admin panel and navigate to Tools>>Export, and you and see an option to "Choose what to export," from which, you have to select the "All Content" radio button.
Click on the "Download Export File" button, and the download starts. Depending on the size of the file and your internet speed, you can see an XML file in your computer.
Now that you have successfully secured the content of your site, you should take the next step to back up the design and media files.
2). Back up the wp-content Folder
You should know that WordPress stores themes, plugins, and media files in the wp-content folder. It's vital to download it to maintain the SEO score.
Exporting the data doesn't always contain all media files, so, you have to upload them later. To save the hard work, it's better to do something smart.
To download wp-content, you can either use cPanel or FTP.
Let me show you the steps using cPanel:
Log into your cPanel account and open the File Manager. I hope you know that all the data of a WordPress website resides inside the file manager.
From the life hand sidebar, you have to open public_html. If you have only one website, WordPress installation is available in the public_html directory.
If you run multiple websites on the same web hosting account and uninstall and reinstall WordPress for an addon-domain, subdomain, or subdirectory, you have to find the right folder name where WordPress has its data.
Search for the wp-content folder and compress it to make a ZIP file. Right-click and choose "compress."
A popup appears where you need to select the compression type, select the ZIP radio button and click on Compress File(s).
Once the compression process finishes, refresh the page, and you can see a ZIP file to download.
3). How to Uninstall WordPress Completely?
You're already in the file manager. After backing up wp-content, it's time to delete all files and folder from the root directory.
Click on Select All option from the cPanel's navigation menu, and click on the Delete option from the main menu.
A popup appears you to ask for confirmation because once you delete the content, it's irreversible. Follow the instructions and delete everything.
Once you do so, the first part of installing WordPress is complete.
You may be wondering about the database. Don't be worried; you don't need to delete a database to reinstall WordPress, you can always create a new database and use it.4). How to Create a New Database?
Nowadays, almost every web hosting company offers a few clicks options to create a new database. Let me show you how:
Open cPanel and scroll down to the databases section. Click on the MySQL Databases icon.
On this page, you can see an empty field to create a new database. Fill in the name, and scroll down.
Now is the time to create a new database user. Fill in the details, and make sure to keep the password strong.
You need to add the new user you just created to your database.
Once you fill in all the details, you can see a new database at the bottom of the page with other databases. Now that you have created a new database, it's time to install WordPress.5). How to Reinstall WordPress?
Using an old fashioned way to download the ZIP file from the WordPress' official site is not what I am going to recommend.
Most famous web hosting companies offer one-click WordPress installation. Use that option and install WordPress. Don't worry about any other data because you have already deleted the old WordPress installation.
6). Import the Content to the New WordPress Installation
Log in to your website having a fresh WordPress installation and go to Tools>>Import.
On this new page, you have to install the WordPress importer. Once you do that, the text transforms into "Run Importer".
After that, choose an XML file you exported from your website in the first step, and click on Upload file and import to start the process.
You will be asked to choose the author for the content. If you had multiple authors on your previous WordPress installation, you can create new users and assign the content to them. You can also assign all the content to only one author.
Continue and complete the import process.
7). Restore Themes and Uploads
If you remember, you downloaded wp-content from your old WordPress installation. To complete the reinstalling process, you have to restore "uploads" and "themes" to your new WordPress installation.
Unzip the wp-content backup and extract the folder.
Now if you want to use the same old design, you have to upload the "themes" folder. Uploading the "uploads" folder is important.
If you wish to use FTP, you can simply upload these folders to wp-content. If you use cPanel, first you have to ZIP these two folders in the same file.
Go to file manager>>public_html>>wp-content of your new WordPress installation, and click on the Upload icon from the main navigation menu of cPanel.
A new tab opens up, choose the ZIP file containing "uploads" and themes" folders and start uploading. Once finishes, you have to unzip the file.
NOTE: You will see the themes folder, so you will be asked to replace it.
You have accomplished your goal to uninstall and reinstall WordPress. Now, you may be wondering about plugins.
It's important to know that behind any malicious attack, most of the time, there's a plugin's file. So, it's good to install plugins manually.
I Hope You Find it Easy to Uninstall and Reinstall WordPress
I understand how hard it's when you encounter an error on your WordPress website. Sometimes, all the conventional troubleshooting techniques don't help.
At such point, you may think to uninstall and reinstall WordPress to fix any malicious code injection in any of the core files. To do so, it's vital to secure the content as I explained in the tutorial.
If you use a shared web hosting, most probably you get a cPanel; otherwise, you can always use FTP/SFTP. I hope it's not as hard as you thought in the first place.