Resetting your site to an empty WordPress installation

Sometimes you may want to start your site development over from square one, where there is only a clean WordPress installation on the site. These instructions will get you pretty close to that situation. 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:

wp-backup

Option 1: Returning the website to its starting point

If your site has a copy of the original database in the directory  /data/db/ you can use it to restore the site. This copy can be recognized from the .sql.orig ending of the file. In this example the database file name is example_a1b2c3. Run the following commands: 

rm -rf /data/wordpress 
cp -r /usr/share/seravo/wordpress /data 
cd /data/wordpress 
composer install 
wp-db-load /data/db/example_a1b2c3.sql.orig
wp theme list
wp theme activate exampletheme

Here is an example of checking .sql.orig file in /data/db/ folder and running previously mentioned commands:

Option 2: Emptying the whole site or parts of it manually

Optionally you can empty the site partly or entirely by running the following commands: 

rm -rf /data/wordpress 
cp -r /usr/share/seravo/wordpress /data 
cd /data/wordpress 
composer install 
wp db reset 
wp core install --prompt

Note that with this option you will need to manually fill in all the information the process asks. Here is an example of running previously mentioned commands:

Finally: clear the site cache

wp-purge-cache

Reload the page in your browser (Ctrl/Cmd+F5). After this the opening site should have an empty WordPress site with default theme! 

 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.