person in black and white t-shirt using computer

How to delete WooCommerce from WordPress database?

Do you know that most of the time when you deactivate and delete a plugin in WordPress it does not get removed completely from the database? Yes! You read that right.

In most cases when you delete a plugin, or even a theme, from WordPress, some of the data still remains intact in the database. This is because WordPress thinks that you might have either done it by mistake or might install that plugin sometime later. So to make things go smoothly it does not completely remove it from the database.

Let’s talk about WooCommerce. It is undoubtedly the best online shopping plugin for WordPress to create your own shopping website. Many people use it on a daily basis to sell their products online. And many people like me just test it out and then remove it.

So if you are like me and want to ‘get rid’ of WooCommerce from your database too then you will have to actually do it manually.

How to completely uninstall WooCommerce from WordPress

Don’t panic as it isn’t that hard. Just a couple of steps and all ‘residue’ that it left in your database will be wiped off.

The Steps

For the successful removal of WooCommerce please follow all these steps.

  1. Backup – Before doing anything it is advisable that you take a backup of your WordPress database. And if you plan to use WooCommerce sometime later then it’s back up too (products, categories, etc).
  2. Using FTP go to the public_html folder and locate the wp-config.php file
  3. Take a backup of the wp-config.php file too. It’s better to be safe than sorry.
  4. Now add the following code right above the /* That’s all, stop editing! Happy blogging. * line.[sourcecode language=”plain”]define( ‘WC_REMOVE_ALL_DATA’, true);[/sourcecode]
  5. After completing step 4, all you have to do is go to Plugins > Installed Plugins and then Deactivate and Delete WooCommerce just like you deactivate and delete any other plugin. No rocket science here.
  6. Once you delete the plugin, open the wp-config.php file once more and remove the line that you added in step 4. Now save the file.

Wait. The work isn’t over yet! WooCommerce, as I have noticed, is really stubborn. Even after doing all this work does not get fully removed from your WordPress install. So the next steps have to be taken.

Database Tinkering

In order to uninstall WooCommerce completely from the WordPress database, you will either have to go to phpMyAdmin or do it the easy way by installing a plugin.

I will recommend you to do it with the Advanced Database Cleaner plugin, or any other such plugin that you like. Why? Because you can easily remove other plugins too from your database if required in the future. Also, this plugin helps you to optimize the database tables, remove post revisions and so much more. In fact, this is quite handy.

Once you install and open the settings page of the plugin, head over to the Tables tab. Here you will see all the tables in your WordPress database. DOUBLE/TRIPLE CHECK the checkboxes before you do any deletion here as once you delete these tables there is absolutely no way to go back.

Select all the WooCommerce tables and press delete. It will ask once again for confirmation. Now, these tables have been successfully removed from your database. Congratulations!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *