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.
Related: How to delete W3 Total Cache plugin completely?
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.
Quick Way
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:
define(‘WC_REMOVE_ALL_DATA’, true);
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.
free_shipping | _order_shipping_tax | _crosssell_ids |
_shipping_country | _shipping_postcode | _completed_date |
_shipping_first_name | _order_total | _backorders |
_shipping_last_name | _date_completed | _order_shipping_tax |
_shipping_company | usage_limit_per_user | usage_limit |
_shipping_address_1 | usage_count | product_ids |
_shipping_address_2 | product_categories | Payer last name |
_shipping_city | minimum_amount | maximum_amount |
_shipping_state | limit_usage_to_x_items | _product_attributes |
_order_shipping | _refund_amount | _purchase_note |
_sku | _product_image_gallery | _sold_individually |
_upsell_ids | individual_use | customer_email |
_customer_ip_address | _customer_user_agent | _customer_user |
_tax_status | _tax_class | _order_tax |
_prices_include_tax | _cart_discount_tax | _wc_rating_count |
_wc_average_rating | _billing_country | _billing_first_name |
_billing_last_name | _billing_company | _billing_address_1 |
_billing_address_2 | _billing_city | _billing_state |
_billing_postcode | _billing_email | _billing_phone |
_billing_country | _order_version | _order_currency |
_order_key | _sale_price_dates_from | _sale_price_dates_to |
_min_variation_price | _max_variation_price | _min_price_variation_id |
_max_price_variation_id | _min_variation_regular_price | _max_variation_regular_price |
_min_regular_price_variation_id | _max_regular_price_variation_id | _min_variation_sale_price |
_min_sale_price_variation_id | _max_sale_price_variation_id | _max_variation_sale_price |
_regular_price | _sale_price | _sale_price_dates_from |
_sale_price_dates_to | _price | coupon_amount |
_created_via | _recorded_coupon_usage_counts | _downloadable |
_download_limit | _download_expiry | _downloadable_files |
_cart_discount | _cart_discount_tax | _paid_date |
_payment_method | _payment_method_title | Payment type |
_stock_status | _manage_stock | total_sales |
_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:
wp_actionscheduler_actions | wp_wc_order_product_lookup |
wp_actionscheduler_claims | wp_wc_order_stats |
wp_actionscheduler_groups | wp_wc_order_tax_lookup |
wp_actionscheduler_logs | wp_wc_product_meta_lookup |
wp_wc_admin_notes | wp_wc_tax_rate_classes |
wp_wc_admin_note_actions | wp_wc_webhooks |
wp_wc_category_lookup | wp_woocommerce_api_keys |
wp_wc_customer_lookup | wp_woocommerce_attribute_taxonomies |
wp_wc_download_log | wp_woocommerce_downloadable_product_permissions |
wp_wc_order_coupon_lookup | wp_woocommerce_log |
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.
Related: How to make WooCommerce works with W3 Total Cache?
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.
Final Words
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.
Leave a Reply
Your email is safe with us.