When your website has a big problem that nothing can seem to fix, reinstalling WordPress can be recommended as a last resort.
But you’re obviously worried about losing your data – blog posts, pages, theme styling, and so on. Reinstalling WordPress only to find all your hard work gone would be devastating.
With the right approach, you can safely reinstall WordPress without losing any data. In this guide, we’ll walk you through how to reinstall WordPress while protecting your data. Several methods are outlined so you can pick the most convenient one for you.
Table of contents
When to reinstall WordPress
Sometimes your attempts at debugging and troubleshooting WordPress issues just aren’t going anywhere, and reinstalling WordPress is the only option that remains.
This is usually left as a last resort, as it requires quite a bit of preparation and, depending on the method you choose, work to pull off. It can also result in data loss if you don’t take the necessary precautions, so you’ll need to be extra careful.
Here are some times when reinstalling WordPress is the right choice.
- Corrupted core files – Core WordPress files can become corrupted due to incomplete updates, a failed WordPress installation, or other bugs. You might be seeing a White Screen of Death or a critical error that’s making your website inaccessible, and possibly can’t even access the WordPress dashboard. Times like this, reinstallation is the best choice.
- Persistent technical issues – Sometimes, troubleshooting persistent errors and conflicts can become an endless cycle that goes nowhere. If you just can’t seem to fix a particular issue, reinstalling WordPress can sometimes provide a clean slate clear of glitches and corruption.
- Malware or security issues – If WordPress core files have been compromised by malware, reinstalling WordPress is often a good way to ensure that all malicious code has been scrubbed. However, viruses can infect more than just core WordPress files, so you’ll need to take other steps to remove the malware entirely.
- Migration problems – Migrations can be finicky. When migrating your site to a new server or domain, you may run into glitches or corruption. Reinstalling WordPress could be a quick way to resolve these.
- Optimization and cleanup – Over time, your WordPress installation can accumulate unnecessary or outdated files and data, like old plugin data. Reinstalling WordPress helps in cleaning up these remnants and could possibly speed up your site or clear up server space.
Whatever reason you have for reinstalling, we’ll help you do it properly while saving your data.
Backup your data before reinstalling
Before you uninstall WordPress and reinstall it or touch its core files in any way, there are a few important steps you should take first – most importantly of all, backing up your website.
Should anything go wrong while reinstalling WordPress, you’ll be able to restore any lost data.
There are multiple ways to backup your website. Let’s go over how to take a full backup using the UpdraftPlus plugin.
1: Install and activate UpdraftPlus through Plugins > Add New.
2: Navigate to Settings > UpdraftPlus Backups
3: Click the blue Backup Now button and configure your backup settings in the popup.
4: Make sure you have included your database in the backup, as this is where your user data like posts and pages are stored. Include files covers things like uploads, themes, plugins, and anything in the wp-content folder.
5: Click Backup Now.
If you’re using a premium version of UpdraftPlus, make sure you don’t back up core WordPress files. Resetting these to a former state would be counter-intuitive to reinstalling WordPress.
You can return to this page and re-upload your backup file if you need to.
Other steps to take before reinstallation
Besides backing up your WordPress site, there are a few other things to do before you start the reinstallation process.
1: Deactivate plugins – While the chance is small, leaving plugins active could result in conflicts or corruption during the reinstallation process. You don’t need to delete your plugins entirely; just deactivate them all temporarily. And if you can’t get to the dashboard, here’s how to deactivate plugins manually.
2: Switch to a default theme (optional) – This isn’t usually necessary, but if you try to reinstall and have issues, consider swapping to a default theme like Twenty Twenty-Three temporarily. Just make sure you backup your theme files first as you could lose your styling and settings. And again, here’s how to switch your theme manually if the dashboard is inaccessible.
3: Note down important settings – Take a moment to document your non-default site settings and any special customization you’ve done. Think permalink structure, widget/plugin settings, and any custom code snippets in your functions php file. If these don’t get saved during the reinstallation process, you’ll be able to reconfigure quickly.
Now that you’ve taken the necessary steps to protect your data, let’s get into actually reinstalling WordPress.
Before starting: Reinstall WordPress themes and plugins
Before you go all-in on reinstalling the entire WordPress site, sometimes a simpler solution, like reinstalling themes and plugins, can resolve an issue. It will also have a much smaller impact if something does go wrong, but it’s just as important to take multiple backups beforehand.
First up: if you’ve modified your theme template files directly rather than using a child theme, these changes will be lost. Make sure to note down any custom code you’ve added, and use a child theme next time, as without one any theme template styling will be deleted whenever you update.
You should also write down other styling info, like additional CSS or theme options. Some themes save these in the database even when uninstalled. Others do not, so make sure you note down anything you want to save. The same goes for plugins; some save their settings, and others don’t.
Here’s how to reinstall your themes and plugins.
1: Navigate to Appearance > Themes. Pick a default theme like Twenty Twenty-Three and click Activate.
2: Hover over the problem theme, click Theme Details, and click the Delete button at the bottom of the popup.
3: Click Add New Theme, and either search for your old theme or upload it through Upload Theme. Click to Activate it.
4: Now head to Plugins > Installed Plugins. Deactivate and delete all your plugins one by one.
5: Go to Plugins > Add New and reinstall all your plugins.
6: Reconfigure any settings or styling that wasn’t saved.
Method 1: WordPress’ built-in reinstaller
If a full WordPress reinstall turns out to be necessary, there’s a really easy way to do it built right into the CMS. This is quick, easy, and shouldn’t delete anything other than WordPress core files.
1: Navigate to Plugins > Updates.
2: WordPress will check for updates now. When it’s finished, you’ll be able to reinstall the current version. Click Reinstall version <your WP version>.
And that’s it. WordPress will re-install the latest update files, and none of your personal data should be affected at all
Method 2: Reinstall via FTP
If the simple reinstaller doesn’t help, you may need to clear things out manually. For this, you’ll require FTP access, which not all web hosts grant. Here’s how to reinstall WordPress via FTP.
1: First, obtain your FTP client credentials. Check your hosting dashboard (such as cPanel). In cPanel, you can find this in the FTP Accounts tool under Files. Note down your FTP username, server, and port. If you can’t find it, ask your web host for help.
2: Install an FTP client like FileZilla. Launch the program and input your FTP credentials, then click Quickconnect.
3: While you have the FTP client open, you may wish to manually take another backup of your WordPress files, especially the wp-content folder. Just press Ctrl-A to select all folders, then right-click and click Download.
4: Head to WordPress.org and download the latest version of WordPress.
5: The wp-content folder contains your plugins, themes, and uploaded image/media files. You don’t want to overwrite these, so open the WordPress zip file you installed in the last step and delete the wp-content folder.
6: In your FTP client, upload this folder to your root folder (in the left panel, right-click the WordPress folder you downloaded and click Upload), and confirm anything it wants to overwrite.
7: Alternatively, you can delete all files except the wp-content folder on your website in the right-hand panel, and then upload the zip file.
You’ll want to save a copy of your wp-config.php file, and any .htaccess files you have configured. Similarly, if you have any other customizations, do keep a copy of these files to re-upload them later. If in doubt, speak to your developer.
Method 3: Reinstall through WP-CLI
If you’re a technical user who’s familiar with working in the command line, you may instead want to reinstall through WP-CLI, a command-line interface (CLI) for WordPress.
This has the benefit of being fast and not having to deal with any clunky interfaces. All you need to do is input one line of code to reinstall WordPress. On the other hand, non-technical users will likely struggle to install WP-CLI.
Here’s how to reinstall WordPress using WP-CLI.
1: First, install WP-CLI on your server. This will require command line access to your server and ideally a Unix-like environment. Your server may already have this installed, so check for that first. You can run the wp cli info command to check if it’s already installed.
2:
3: Next, open the Terminal on your server and enter this code: wp core download –skip-content –force
This will reinstall WordPress core, forcing it to overwrite all core files. However, your existing wp-content folder won’t be overwritten.
Just like we advised in Method 2 above, do keep a copy of your wp-config.php file, .htaccess files, and any other custom files. You’ll then be able to restore them after.
Method 4: Reinstall with a plugin
Finally, if none of the above works or you’re unable to access features like FTP and CLI, you may wish to try out a plugin: WP Reset.
With this, you’ll be able to wipe every part of WordPress and reset it, while keeping your content and plugin settings intact. It also has a restore function in case you delete the wrong thing.
Note, though, that the only options available in the free version of the plugin – Site Reset and Nuclear Reset – will delete user data like posts, comments, and media.
Options Reset will only reset settings and leave your important data untouched. However, this is a pro feature, so you’ll need to buy the premium plugin.
1: Head to Plugins > Add New to install and activate the WP Reset plugin.
2: Navigate to Tools > WP Reset.
3: Click the Snapshots tab, and click Create Snapshot to create a copy of your database. Note that WP Reset does not create copies of WordPress files, only database items.
4: Click back to the Reset tab. You’ll see a table going into depth on exactly what will be deleted and what won’t. Take note of this and read carefully.
5: Use the Options Reset table to reset settings without touching user data.
6: Alternatively, click the Tools tab to delete specifically any data you want to get rid of.
By clearing out WordPress’ settings and starting from scratch, you may be able to solve whatever issues are plaguing your site.
4 methods to easily uninstall and reinstall WordPress
Reinstalling WordPress doesn’t have to be stressful. By following the steps outlined above, you can backup your data to keep it safe and reinstall WordPress without losing it.
Remember to backup your website and WordPress installation using multiple methods, export your content, and document your important settings and custom code before proceeding. Whether you use the built-in installer, FTP, the command line, or a plugin, your content will be safe and your WordPress site should be up and running again soon.
And if the reason for reinstalling WordPress was due to a security issue, check out our plugins like Melapress Login Security and WordPress 2FA. These can help prevent bad actors from breaching your website and installing malware or corrupting your core files.