Resetting your website database can be useful if you are testing new plugins, themes or templates. If needed, you can delete the whole WordPress installation (files and database) and reinstall it, which is time-consuming. Fortunately, there are a couple of other methods to help you reach the same end faster and easier.
In this article, we’ll explain how to reset the database with the WordPress Database Reset plugin and WordPress CLI.
WordPress Database Reset Plugin
The WordPress Database Reset plugin is one of the most popular plugins for resetting the database.
Installing the Plugin
All the steps that are mentioned in this article require the WordPress Database Reset plugin. Therefore before following the steps, make sure that you have installed and activated the WordPress Database Reset plugin.
To install the WordPress Database Reset plugin:
Resetting Database
After installing and activating the WordPress Database Reset plugin, you are ready to reset the database. This process will not delete your theme or plugin data. You will still be able to use the themes and plugins.
To reset the WordPress database:
WordPress CLI
WordPress CLI is a command line interface for managing WordPress. Its intended for developers so if you are not a developer, its best to use the above mentioned plugin.
If you have WordPress CLI installed, you can reset the database using the following command line:
wp reset database
You can even specify a list of table to reset:
wp reset database --tables='users, posts, comments, options'
The current theme and plugins will be reactivated by default. You can disable them like so:
wp reset database --no-reactivate
You can use the list command if you’re unsure of the database table names:
wp reset list