Uninstall and Reinstall WordPress
Reinstalling WordPress can solve issues when all other troubleshooting tips fail.
When Do You Need to Reinstall WordPress?
Reinstalling WordPress should never be the first option. Most common WordPress errors are easily fixable, and this will save you from the hassle of starting over.
If all else fails, then uninstalling and reinstalling a fresh copy of WordPress can be used as the last resort.
Step 1. Create an Emergency Backup
You should first create a complete backup of your existing WordPress site.
You can use a WordPress backup plugin to do this.
Make sure that you store your backup files on your computer or a cloud storage service.
Use this backup to reinstall WordPress in case something goes wrong.
Step 2. Export Your WordPress Content
Export your WordPress content by creating a WordPress export file.
This file will contain all your posts, pages, categories, tags, and comments.
Restoring a WordPress site using this export file allows you to leave out data created by WordPress plugins.
Sign in to your WordPress admin area and then go to the Tools » Export page from your WordPress dashboard.
From here, select the ‘All content’ option and click on the ‘Download Export File’ button.
Step 3. Download wp-content Folder
All your WordPress themes, plugins, images, and uploads are stored in the /wp-content/ folder on your website.
Download this content to your computer so that you can use it later to reinstall WordPress.
Connect to your WordPress site using an FTP client or File Manager in cPanel.
Once connected, select the wp-content folder, right-click it, and click the ‘Download’ option to save it on your computer.
After downloading the wp-content folder, you are ready to uninstall WordPress.
Step 4. Properly Uninstall WordPress
Using either File Manager or FTP, Download the wp-config.php file from the old blog to your computer.
You will need both the username and password
To uninstall WordPress, you need to connect to your site in cPanel.
Scroll down to Softaculous Apps Installer.
Click on Installations.
Find the blog to Delete.
Click on the Little red Trash can icon on the far right.
Select Remove Installation.
This will totally remove all files, folders and databse info.
At this point the blog no longer exists.
Step 5. Fresh Install WordPress
In CPanel, Scroll down to Softculous Apps Installer and Select Installations.
Click on Install.
Enter the required information.
Since this is a brand new blog, change the username and password to something you can remaber and also, write it down.
Click on the Install button.
After the install hs completed, you have new blog.
Next, go ahead and log in to the WordPress admin area using the username and password you entered earlier.
Once you are logged into WordPress, you need to delete the default content.
Simply head over to Posts and delete the ‘Hello World’ post.
You can also visit the Comments section and delete the default comment.
Go to Pages and delete the sample page.
You have successfully installed a fresh copy of WordPress into a new blog.
Step 6. Restore Uploads, Images, and Theme
Restore your uploads, images, and theme, which are located inside the wp-content folder you downloaded earlier.
Connect to your website using an FTP client and go to the /wp-content/ folder.
Select the /wp-content/uploads/ folder from your computer and upload it to your website.
Your theme folders are located in the /wp-content/themes/ folder.
Step 7. Import Content
Import your posts, pages, categories, tags, and other content.
Go to the Tools » Import page and then click the ‘Install Now’ link under WordPress.
WordPress will now download and install the WordPress importer.
Click the ‘Run Importer’ link.
This will bring you to the WordPress importer page, where you need to click on the ‘Choose File’ button.
Select the XML file you downloaded during step 1.
Once that’s done, click the ‘Upload file and import’ button to continue.
WordPress will ask you if you want to create new authors and assign the posts to them or if you would like to assign all posts to your current user account.
If it is a single-author WordPress site, you can assign all posts to yourself.
You also need to check the box under ‘Import Attachments’.
This will allow WordPress to import the images from your /wp-content/uploads/ folder to the WordPress media library properly.
Click on the ‘Submit’ button to continue.
WordPress will now start importing content from the XML file to your fresh WordPress install.
Once finished, you will be able to see your content by visiting your website.
Step 8. Install WordPress Plugins
You will need to install all plugins one by one and then activate them.
You may also need to manually set up plugins to adjust their settings.
You have successfully uninstalled and reinstalled WordPress.
You can now review your website and set up things as they were before, like your navigation menus, sidebar widgets, contact form, and more.
This is lot of steps to follow.
Better and easier solution is to make sure you are backing up your blog on a regular basis with the Duplicator plugin.
This will backup everything.
You can then delete the blog from within Cpanel.
Then you can create a new blog and restore the backup that you previously created.