How to Delete WooCommerce Plugin Completely?
WooCommerce is one of the popular ecommerce plugin for WordPress site. The popularity comes due to the fact that Automattic the company behind WordPress is the same developer for WooCommerce. In addition, many popular themes offer WooCommerce as a bundled plugin with integrated theme function. We are using WooCommerce on our site from 2015. Here is why we decided to delete and the complete process of deleting WooCommerce from your WordPress site.
Why to Delete WooCommerce?
Though popular, WooCommerce has many problems in terms of usability.
- It slows down the site with too many scripts and options. Learn more on how to fix slow WooCommerce store with admin Ajax problem.
- The plugin adds many custom fields in wp_postmeta table. If you see the table grows bigger, then WooCommerce is the culprit to blame (assuming if you are not using any other plugins that add meta data).
- Surprisingly it is not easy to migrate the store to another site or subdomain or subdirectory.
- It adds 20 SQL tables in the database, occupying much of DB storage.
- The latest WooCommerce version includes the “Analytics” section. This will add more pressure on the server in addition to already heavy plugin.
- It creates lot of transient and log files which you need to cleanup regularly.
The bigger problem in our case is the migration. We use 2K+ blog posts with 50+ WooCommerce products. With this situation, WooCommerce slows the site almost 1 second and occupy 50% of database size. In addition, we have to allow user registration only to accommodate WooCommerce customer registration. This is inappropriate for us to keep the plugin on the main site that affects 95% of other content. Therefore, we decided to move the store section to subdirectory.
Again, we get struck as the migration process is so complex that makes you frustrated.
How to Delete WooCommerce Plugin Completely?
Being said all the above facts, WooCommerce will add tons of backend stuff to your WordPress installation. You have to get rid all those stuffs to completely remove the plugin.
- Cleanup WooCommerce data before deleting the plugin
- Delete customer details from “Users” section of admin panel
- Deactivate and delete the plugin from admin panel
- Remove custom fields from wp_postmeta table
- Delete database tables using phpMyAdmin
- Check and delete files from backend
Let us explain each step in detail.
Before we explain the detailed way, there is a quick solution to get rid of WooCommerce data completely. Edit your wp-config.php file through FTP or File Manager and add the following line:
Make sure to use straight quotation marks and add the code just above the /* That’s all, stop editing! Happy blogging. */ line in the file. After that, deactivate and delete the plugin from your admin panel. Later, you can again go back and remove the above code from wp-config file. This will completely delete all WooCommerce data from your WordPress installation.
If you want to manually delete the plugin then follow the below instructions.
1. Cleanup WooCommerce Data
When you decided to delete the plugin, first delete all relevant data from the admin panel.
- Delete all product pages and categories by navigating to “Products > All Products / Categories” sections.
- Remove all coupons and orders under “WooCommerce > Coupons / Orders” sections..
- Delete log data from “WooCommerce > Status > Logs”.
- Cleanup transient data under “WooCommerce > Status > Tools” section.
2. Delete Customer Details
When a user purchase a product through WooCommerce store, WordPress will create a user account with “Customer” as a role. You have to delete all customer users on the site after deleting the plugin.
- Go to “Users > All Users” section in admin panel.
- Click on the “Customer” to filter all customer users.
- Click “Bulk Actions” dropdown and select “Delete” option.
- Select “Apply” button to delete all the selected customer users.
If the customer data spread across multiple pages, you have to delete them multiple times. Click on “Screen Options” to setup number of items per page to 100 or more, so that you can delete them quickly.
3. Delete WooCommerce Plugin
This is pretty simple step. Login to your WordPress admin panel and navigate to “Plugins > Installed Plugins” section. Fins and deactivate WooCommerce plugin. After deactivation, you can simply delete the plugin from your site.
Deleting the plugin will only remove the plugin files from your site. However, there are many integrations created by the plugin needs manual effort.
Related: Fix slow loading WooCommerce store.
4. Remove Custom Fields
WooCommerce uses hundreds of custom fields for different actions. WordPress will store all these custom fields as meta keys in wp_postmeta table that you need to delete manually. Ensure to delete ONLY WooCommerce custom fields to avoid affecting other functions on your site. Unfortunately, we could not find any custom field list for WooCommerce. Here are the meta keys we found in postmeta table we found on our database.
|_shipping_address_2||product_categories||Payer last name|
|_recorded_sales||is_vat_exempt||Payer PayPal address|
|PayPal Transaction Fee||_paypal_status||_transaction_id|
Follow the below instructions to delete them from your database.
- Login to your hosting account and open cPanel.
- Search and open phpMyAdmin app.
- It will open the database of your site with all table details.
- Go to “xx_postmeta” table where xx is the table prefix you used during WordPress installation process.
- We recommend you to take the backup beforehand and browse the table for finding the available custom fields on your site.
- You can use SQL query to first find the number of occurrences of any field before deleting.
For example, use the below query in the textbox under “SQL” tab to find the meta keys that contains “ship”.
SELECT * FROM wp_postmeta WHERE `meta_key` LIKE ‘%ship%’
Once you confirm the selection, edit the query like below to delete them from your database.
DELETE FROM wp_postmeta WHERE `meta_key` LIKE ‘%ship%’
You can directly use the delete query, if you know the correct meta key value (custom field value).
5. Delete Database Tables
Unfortunately, deleting the plugin will not delete the database tables in the backend. When you are in phpMyAdmin section of cPanel, select the WooCommerce tables and delete them manually. Below are the table we found in the database:
When you are in phpMyAdmin section, select table and go to “Operations” tab. Click on “Delete the table (DROP)” option and confirm the prompt to delete the table and content.
6. Delete Files
The last step we believe is to delete the residual files created by WooCommerce plugin.
- Login to your hosting server using FTP account.
- Check the “Uploads” folder under “/wp-content/”.
- You may find WooCommerce placeholder images, “woocommerce_uploads” folder containing downloadable files, logs and GeoIP database.
- Delete all these WooCommerce files from your server.
Many users delete the plugin from the admin panel and assumes that is enough. Unfortunately, it is not and you have to manually remove all the traces. Leaving the residual database and file content will continue to impact the size and loading speed of your site.