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.

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.

Related:  How to Add Table in WordPress?

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.
Cleanup WooCommerce Store
Cleanup WooCommerce Store

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.
Related:  How to Use Flexible Drag and Drop Header in Weebly?

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_companyusage_limit_per_userusage_limit
_shipping_address_1usage_countproduct_ids
_shipping_address_2product_categoriesPayer last name
_shipping_cityminimum_amountmaximum_amount
_shipping_statelimit_usage_to_x_items_product_attributes
_order_shipping_refund_amount_purchase_note
_sku_product_image_gallery_sold_individually
_upsell_idsindividual_usecustomer_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_pricecoupon_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_titlePayment type
_stock_status_manage_stocktotal_sales
_recorded_salesis_vat_exemptPayer 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.
Related:  Beginners Guide to SEO for Magento Store

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%’

Check Meta Keys from Post Meta Table
Check Meta Keys from Post Meta Table

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_actionswp_wc_order_product_lookup
wp_actionscheduler_claimswp_wc_order_stats
wp_actionscheduler_groupswp_wc_order_tax_lookup
wp_actionscheduler_logswp_wc_product_meta_lookup
wp_wc_admin_noteswp_wc_tax_rate_classes
wp_wc_admin_note_actionswp_wc_webhooks
wp_wc_category_lookupwp_woocommerce_api_keys
wp_wc_customer_lookupwp_woocommerce_attribute_taxonomies
wp_wc_download_logwp_woocommerce_downloadable_product_permissions
wp_wc_order_coupon_lookupwp_woocommerce_log
WooCommerce Tables in Database
WooCommerce Tables in 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.

Delete Table from Database

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.

Recommended Articles:

Leave a Comment