How to Completely Reset WordPress Website

How to Completely Reset WordPress WebsiteAlthough not an ideal option, there are situations where you would need to reset your WordPress website.

Many new WP users immediately get cold feet when the thought of resetting their website comes to mind. The process is not as hard as you may be thinking, but you need to be cautious and know the implications before you proceed.

In this guide, we will show you two easy ways to completely reset your WordPress website. Before that, you may be wondering why you need to restart WordPress.

We will present two situations that may require resetting your WordPress installation as well as cases where resetting might not be the best option.

Content:

  1. Why Reset WordPress?
  2. Do you Need to Reset Your WordPress Website?
  3. How to Completely Reset your WordPress Site
  4. Conclusion.

Why Reset WordPress?

Resetting a WordPress site will restore the database to its initial state, giving you a clean WordPress installation, void of any content (posts, pages, comments, etc).

Although WordPress is the most popular software for building robust websites on the internet, sometimes you just need to reset the software to have a clean slate of your site. It is much like resetting a smartphone to factory settings.

There are many reasons you might need to reset your WordPress site. Below we will show you two reasons why you would want to restart your site.

Debugging an error on a New WordPress Site

Managing a WordPress site comes with a lot of challenges. Sometimes, we are faced with errors that have proven difficult to resolve.

If you are faced with such issues on a brand new site you’re working on, you can simply reset your site and restore WordPress to its default settings. This will remove all the files on your database, leaving you with an error-free WordPress installation (i.e. the way the site was when you first installed WordPress).

Testing new features on a staging site

A staging site is used to mirror your WordPress website and is not visible to your viewers. It is mainly used to test new features, upgrades, and customizations before pushing them to the live site.

If you are a WordPress developer, chances are that you will be using a staging site to test new features on themes and plugins. For this reason, your staging site may get clustered with a lot of unnecessary files.

Luckily, WordPress has a reset feature that you can activate using a wp reset plugin or by manually clearing your database from the server.

Do you Need to Reset WordPress?

Well, this depends on the site administrator. However, there are cases where you might think you need a Reset but in reality, it is not the best way forward.

For instance, if you just want to delete your blog posts and pages, then resetting your site might be a step too far. This is because it can be achieved from the admin dashboard without necessarily using the Reset feature.

Deleting All Posts from WordPress

To delete all your posts, login to your WordPress dashboard. Then click on Posts >> All Posts.
After that, click on the box to select all the posts on the page as seen in the image below.

wordpress reset

Next, click on the Bulk actions dropdown and then select ‘Move to Trash’.

Click on Apply. This will move all your blog posts to the Trash.

If you want to permanently delete it from your site, then click on the Trash tab and then select the ‘Empty Trash’ option.

reset wordpress

This process is irreversible so you should be sure before permanently deleting your content.

Side Note: To increase the number of posts displayed per page, click on the screen options dropdown menu. Next, type the number of posts you wish to display per page, then click on Apply.

 

You can apply the same procedure we used above to remove pages from your site too.

Deleting/disabling Themes and Plugins

If you wish to delete themes or plugins from your site, or if disabling plugins is the reason you intend to restart your site, then there wouldn’t be any need for that since you can achieve that through cPanel or via an FTP client.

Please read this guide to learn how to disable themes using FTP. For plugins, we also have a detailed guide to help you disable plugins using FTP.

However, if you are sure you want to reset your WordPress site, then follow the steps in the section below.

How to Completely Reset Your WordPress Website

Resetting a WordPress site is a one-time step that cannot be undone. For this reason, it is highly recommended to backup your website before using the Reset Button on the site. That way, you can always revert your site to its previous state if you change your mind about the reset.

This guide will show you how to reset WordPress sites using a plugin and through WP CLI. There are several plugins you can use to reset your site, however, we will use the Advanced WordPress Reset plugin.

Using Advanced WordPress Reset Plugin

Firstly, you will need to install and activate the plugin on your WordPress dashboard.

To install the plugin, go to Plugins >> Add New and then type ‘advanced WordPress reset’ in the search field.

advanced wordpress reset

Now, click on Install next to the plugin name as seen in the image above. When the installation completes, click on Activate.

On your WordPress dashboard, go to Tools >> Advanced WP Reset to open the plugin menu.
The plugin will notify you of the implications of resetting your WordPress site.

reset wordpress plugin

For instance, using the reset feature will not completely delete plugins or themes on your website. However, all plugins will be deactivated after the reset is completed. In addition, your site will revert to using the default WordPress theme.

Important: Using this plugin, all the posts, pages, comments on your WordPress site will be lost. It will also remove all the users from your site, leaving only the current logged in user.

Ensure you use a WordPress backup plugin to backup your site before proceeding in case you need to roll back the reset.

To reset your WordPress database, type the keyword ‘reset’ in the box and then hit the Reset database button.

You will be prompted with a confirm reset popup.

Here, you can choose to cancel the process and leave your site as it was if you are not sure you want to restart WordPress. However, if you are sure about it, simply click on Continue.

After the reset is complete, it will restore your website to default settings and you will be redirected to the login page. From there you can input your details to log back into the site.

To confirm that the reset was successful, you can click on your posts tab from your admin dashboard. You should see the standard ‘Hello World’ post. This means all your posts and pages have been deleted.

Side Effects of Using a Reset WordPress Plugin

When you click on the media tab on your WordPress dashboard, you will notice that all the files have been cleared as a result of the WP Reset operation.

However, the files would still be available on your WordPress hosting server. This may not be an issue if the media files on your site before the reset are relatively small.

But it is not the case for sites with large uploads because the files will still occupy storage on your server even though they are not being used by your site.

You can delete them completely from your server using an FTP client. Please see how to use FTP here.

Firstly, connect your site to FileZilla using the steps in the guide above. On the right, you will find your remote (live) site files.

Now, double click on the folder containing your website files (this is usually the public_html directory).

In this directory, double click on the wp-content folder.

After that, double click on the uploads folder.

Here, select all the files/folders using Ctrl+A. Afterward, right click and then select Delete.

reset wordpress - ftp

This would delete all the junk files from your server.

Reset WordPress Using WP CLI

WP CLI (WordPress command-line tool) is helpful in terms of managing your WordPress site from a command-line interface.

You can reset your WordPress site from the WP CLI terminal window. Resetting your site using wp cli will delete all your posts, comments, and pages. However, it will not modify or delete any user from the users’ table.

To use this feature, you need to have shell access to your WordPress hosting server. Most managed WordPress hosting and even regular shared hosting come with it by default. You can find your shell access details in the ‘Manage Shell’ tab on the cPanel of your hosting.

cpanel - reset wordpress

If your WordPress hosting does not provide shell access, you can simply use the plugin method above to reset your website.

How to Connect WordPress site to Shell Access 

The procedure of connecting to Shell varies depending on your operating system.

For Linux and OSX Operating Systems, you can use the SSH command from your default terminal window.

To start, open the terminal, then copy and paste the code below.

ssh USER@SERVER -pPORT

Replace USER with your cPanel username or VPS user. Next, replace SERVER with your host IP address. Lastly, replace the PORT with the ssh port number of your host server.

If you are on a Windows OS, you will need an SSH client such as PuTTY to connect to your website.

First, download and install PuTTY on your system. Then open the application as soon as the installation is complete.

Here, input your website address or your server’s IP address. Next, enter your SSH port number in the text input box.

putty - reset wordpress

Now, set the connection type to SSH and then click on Open to launch the terminal window.

In this terminal, enter the username and password of your hosting server.

The next step after connecting your site to an SSH terminal is to navigate to your WordPress site’s root directory. It can be achieved using the ‘cd’ command followed by the name of the folder.

cd public_html

If your site is in another folder, then replace ‘public_html’ with your sites’ folder name. To see all the folders in the current terminal window, simply type the ‘ls’ command.

Installing WP CLI 

On your sites’ directory, you will need to install WP-CLI on the terminal window. To do that, paste the code below and then hit enter.

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Now, paste the code below to reset your WordPress site.

php wp-cli.phar site empty

You will be prompted to confirm if you want to continue. Simply type ‘y’ and then enter.
Your site will be emptied upon confirming the reset.

If you want to bypass the confirmation step, copy and paste the code below.

php wp-cli.phar site empty --yes

The –yes parameter, when used, will skip the confirmation.

 

Side Note: By default, WordPress will remove your uploads from the dashboard after resetting your site using the CLI. However, the files will still be available on your server which is bad because your server will be bogged down with junk files.

 

Luckily, there is another parameter we can add to the code above to force WordPress to clear all the files in the uploads folder. For this, copy and paste the code snippet below.

php wp-cli.phar site empty --uploads

The command above will restore your site to its default state and also clear all the files in your uploads folder. 

Conclusion – Reset WordPress

In this article, we have taken you through the steps to reset your WordPress site using plugins, or WordPress CLI.

Although this is not a recommended way to fix issues, there are situations where it might be necessary, especially in a brand new or staging site.

If you are facing any issues on a live site, please check our WP College for help to fix it. And if you can’t do it yourself, you can have one of our WP experts take care of it for you.

As a final caution, the process is irreversible. So if you don’t have a recent backup of your site, you should be careful because you cannot retrieve your files after the reset is completed.

 This post was written by Mesheal Fegor

Mesheal Fegor is a Web/WordPress Developer and technical writer. His WordPress help articles have been featured on Kinsta and other sites. Mesheal holds a master's degree in computer science. His writing focuses on technical WordPress issues, ranging from core WordPress problems, to issues with WooCommerce, and more.

Last edited by: FixRunner Team