Reset WordPress database

Sometimes while developing you may wish to completely reset your WordPress install.

This will delete all the tables in your database and recreate them with the default WordPress schema. So make sure to back up any important data before executing this command.

To reset your WordPress database using WP-CLI, simply open your CLI and navigate to the root directory of your WordPress installation. And type

wp db reset --yes 

If wp db reset command is not working on Local by Flywheel, it might be due to some restrictions in the local environment. In that case, you can try the following steps to reset your database:

  1. Open Local by Flywheel and click on the site you want to reset the database for.
  2. Click on the “Database” tab and then click on the “Adminer” button. This will open up the database management tool in your web browser.
  3. In the Adminer interface, select all the tables in your database, and then click on the “Drop” button. This will delete all the tables in your database.
  4. Once all the tables are deleted, click on the “Import” button and upload the SQL file you want to use to reset your database.
  5. After the SQL file is imported, click on the “Execute” button to execute the SQL commands and recreate the tables.

That’s it! You have successfully reset your database using Adminer in Local by Flywheel. Note that this method deletes all the data in your database, so make sure to back up any important data before executing this command.


Posted

in

,