Sometimes you may want to start your site development over from square one, where there is only a clean WordPress installation on the site. Emptying the site is done through the command line. The first step is to take SSH connection to the server.
Warning!
This will remove all the content, themes and plugins from your website. Be sure to take a fresh backup before continuing with wp-backup.
Emptying the Whole Site to Its Starting Point
You can empty the site (whether production or shadow/staging environment) to its base state with a clean WordPress installation by following the steps below. Note that the final commands vary slightly depending on whether the site has a .sql.orig database file saved.
Execute the following commands one by one:
rm -rf /data/wordpress
cp -r /usr/share/seravo/wordpress /data
cd /data/wordpress
wp db reset
wp cache flush
If the site has a database copy in the /data/db/ folder, which is identifiable by the .sql.orig extension, you can utilize it for restoration. The database name is example_a1b2c3 in this example.
First, check (for example, with the ls command) if the .sql.orig file is found on the site:
ls /data/db/
example_a1b2c3.sql example_a1b2c3.sql.orig
Option 1: File is Found
If the .sql.orig file is found, execute the following commands one by one:
wp-db-load /data/db/example_a1b2c3.sql.orig
wp theme list
wp theme activate exampletheme
wp-purge-cache
Activate a theme visible in the wp theme list output.
Option 2: File is Not Found
If you did not find the .sql.orig file, you can execute the following commands one by one:
wp core install --prompt
wp-purge-cache
In this option, you must manually provide all the information requested by the wp core install --prompt command during the process.
Test Site Functionality
Reload the site in your browser (Ctrl/Cmd+F5). The browser should then open a clean WordPress site with the default theme!
Need Assistance?
Contact our customer service by sending a message to [email protected].
