WordPress can throw you quite the curveball as a beginner. One minute everything is working well, and the next, you’re stuck with a stubborn error.
While most WordPress errors are easy to fix, at times, your only option is to reinstall the whole thing from scratch. Other times, you’re not even at fault. A hacker might render your website unusable, and reinstalling could be your saving grace.
In today’s post, we show you exactly how to reinstall WordPress without losing your content. If you’d like to nuke your WordPress site and start with a blank slate, we cover that as well.
Important Consideration: Before you do anything, it’s crucial to create a backup of your website. While you might not need the backup once you reinstall WordPress, it’s essential to keep a backup should things go wrong. To be on the safe side, automate backups and ensure you always have copies of your website saved on your computer or online.
Without further ado, let us get down to work.
Why/When to Reinstall WordPress?
First things first, why or when would you need to reinstall WordPress? Usually, you reinstall WordPress when you:
- Are stuck with an error even after trying every troubleshooting technique in the book – Don’t run to reinstall WordPress every time an error crops up since, as we said earlier, most WordPress errors are ordinarily easy to fix.
- Need to reset and reuse a testing website – Perhaps, you’re testing themes or plugins. Developers reinstall WordPress all the time due to the nature of their work. I have done it a couple of times with my test website as well.
- Must rebuild or repurpose your website – When hackers spat on my face a while ago, I had to rebuild my sites from scratch. I reinstalled WordPress quickly while saving some of my content, which saved me a lot of time and effort.
In other words, reinstalling WordPress to fix your site is the last resort when everything else fails. That out of the way, let us roll up the sleeves and get to work.
How to Reinstall WordPress: Methods
Reinstalling WordPress is easy even though it might appear challenging at first. It’s fun too, so get ready for a good time. In the following section, we cover four methods to reinstall WordPress.
Method 1: How to Reinstall WordPress from Your Admin Dashboard
Did you know you can reinstall WordPress right from within your admin dashboard? Oh, yes, you can, and it’s amazingly simple.
To reinstall WordPress from the dashboard, navigate to Dashboard > Updates and click the Re-install Now button, as we highlight in the image below.
WordPress will reinstall automatically, and a few seconds later, you should see the welcome page:
It’s important to note that this method only reinstalls WordPress core files. Your theme, plugins, design, content, and everything else remains intact. This is the easiest and most beginner-friendly method of reinstalling WordPress without breaking your website.
Aside: If for some reason, you cannot access your WordPress admin dashboard, you can still reinstall WordPress using the other methods in the post.
Method 2: How to Reinstall WordPress Using WP-CLI
WP-CLI is short for WordPress command-line interface. It’s a free, open-source, and developer-friendly tool that many people use to install plugins, configure multi-site installations, and do so much more without using a web browser.
Run the following command to reinstall WordPress:
wp core install --skip-content --force
The above command will download and install WordPress without harming your content. The method is not meant for absolute beginners – you must know your way around WP-CLI and servers.
Method 3: How to Reinstall WordPress via FTP
Now the fun part. In the following section, you learn how to reinstall WordPress manually. We like that kind of thing, don’t we? If we agree, let’s get to it.
For starters, head over to WordPress.org and download the latest version of WordPress:
Next, extract the WordPress ZIP file to your computer and then delete the wp-content folder:
Note: Deleting the wp-content folder ensures you don’t overwrite the corresponding folder on your web server. The wp-content folder contains your themes, plugins, and media uploads – all that glossy stuff you don’t want to lose.
After that, log in to your website via FTP:
Next, upload the remaining files from the WordPress folder to your site:
Your FTP program (I’m using WinSCP) should prompt you with a message that lets you know you’re about to overwrite files. Agree, and let the upload process continue until all files are uploaded.
And that’s it; you just reinstalled WordPress manually via FTP while preserving your content 🙂
Method 4: How to Reinstall WordPress Without Preserving Content
Let’s say you want to start with a blank slate. You want to nuke the whole thing and start anew without preserving any of your content, themes, or plugins.
Caution: Make sure you’re ready to lose your content before moving forward. If you’d like to keep your posts, tags, comments, categories, and so on, consider exporting the data to an XML file. Alternatively, you can create an emergency backup should you need it later.
Don’t know how to export your WordPress posts?
Well, it’s easy.
In your WordPress dashboard, navigate to Tools > Export, as shown below.
Next, choose All Content and click the Download Export File at the bottom of the screen.
Save the resulting export file safely on your computer. If you don’t need to preserve any content, ignore the above steps, and continue reading.
Delete WordPress Install in cPanel
Most web hosts offer you a one-click installer to setup WordPress in less than five minutes. But did you know you can use the same installer to obliterate your WordPress website? Yes, it’s surprisingly easy too!
If you use cPanel, click the WordPress icon under the Softaculous Apps Installer. Some hosts use the Fantastico app installer, but the process remains relatively the same.
On the next screen, scroll to the bottom, find the website you want to delete, and click the (x) delete icon:
Next, hit the Remove Installation button at the bottom of the next page.
After deleting your WordPress website, you can install a new blank site via your one-click installer or the famous 5-minute WordPress installation.
Bonus: Resetting WordPress via a Plugin
We all love WordPress probably because, for any functionality you need, there is a plugin that keeps you from tinkering with code and scary tech stuff.
If you don’t have time for FTP and the cPanel (and can still access your WordPress admin dashboard), you can use a plugin to reset your site altogether.
WordPress reset plugins are especially useful to theme and plugin developers who want to create a new test site quickly.
WordPress reset plugins delete all customizations, database tables, posts, pages, or specific parts such as theme settings. However, reset plugins don’t delete your media uploads, themes, and plugins. Usually, the plugins deactivate themes and plugins.
Reinstalling WordPress is simple. Typically, the process involves replacing WordPress core files on your site. Now, you can do it manually or opt for any of the automatic options we’ve already covered. The route you take depends on personal preference.