The complete removal of WooCommerce and its data is not (or should not be) a common thing but it might be useful if you need to go back to the previous version of WooCommerce or if just want to start from scratch or if you need to delete some test orders.
Here’s a video how to do it.
If you deactivate WooCommerce and uninstall like you do with any other WordPress plugin this won’t delete the orders and customer data which makes sense otherwise lots of people would freak out.
The only extra step that needs to be done first before you attempt to uninstall WooCommerce is to edit your wp-config.php file and append one line.
You need to add this line right after the starting <?php tag.
define( ‘WC_REMOVE_ALL_DATA’, true);
To edit that file you will need to use an ftp client (e.g. FileZilla). Do make sure that the quotes are correctly pasted (e.g. single quotes look like single quotes) because if they aren’t this can/will crash your site. If you get an error you can manually delete the quotes around WC_REMOVE_ALL_DATA and type them again and upload the file.
Some may wonder why there isn’t a button that can be checked to confirm data deletion.
The problem is people don’t read and especially if they are tired or if they don’t know what they are doing they can click on the wrong checkbox and the order data would be lost.
Sometimes the user needs to be protected from them.
To recap the complete WooCommerce uninstallation steps
- Add the line in the wp-config.php to confirm that you really want the data removed
- Deactivate the WooCommerce plugin
- Uninstall the WooCommerce plugin
- Maybe reinstall WooCommerce plugin
- Remove the line from the wp-config.php in case you uninstall the plugin later.