Home » Web Tutorials » WordPress » How to Completely Delete WooCommerce Plugin from WordPress Site?

How to Completely Delete WooCommerce Plugin from WordPress Site?

WooCommerce is one of the popular ecommerce plugins for WordPress sites. 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 functions. If you are using WooCommerce store and decided to migrate to another option like Shopify or delete the plugin, here is the complete process to clean up 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 styles. 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 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+ 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.

We are using WooCommerce from 2015 and the bigger problem in one of our cases was the migration. We had 3K+ blog posts with 50+ WooCommerce products on that site. With this situation, WooCommerce slowed the site almost 1 second and occupied 50% of database size. In addition, we had to allow user registration only to accommodate WooCommerce customer registration. This was inappropriate for us to keep the plugin on the main site that affected 95% of other content. Therefore, we decided to move the store section to subdirectory and completely delete it on the main site.

Remember that the migration process is so complex that can easily make you frustrated. Learn more about how to migrate WooCommerce store from one WordPress site to another based on our experience.

Completely Delete WooCommerce Plugin

With 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 check the data and 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 > Orders” and “Marketing > Coupons” 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 purchases 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 before deleting the plugin.

  • Go to “Users > All Users” section in admin panel.
  • Click on the “Customer” (on top row) to filter all customer user roles.
  • 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. Find 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 need manual effort.

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, 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%'
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). Learn more on how to delete unused custom fields in WordPress database.

5. Delete Database Tables

Unfortunately, deleting the plugin will not delete database tables in the backend. When you are in phpMyAdmin section, select all WooCommerce tables and delete them manually. Below are some of the table we found in the database. In general, all WooCommerce related tables will have either _wc_ or _woocommerce_ in the name. Since WooCommerce has plenty of add-ons, you may also have additional tables with different naming convention on your database.

wp_wc_admin_noteswp_wc_order_tax_lookup
wp_wc_admin_note_actionswp_wc_product_meta_lookup
wp_wc_category_lookupwp_wc_tax_rate_classes
wp_wc_customer_lookupwp_wc_webhooks
wp_wc_download_logwp_woocommerce_api_keys
wp_wc_order_product_lookupwp_woocommerce_attribute_taxonomies
wp_wc_order_statswp_woocommerce_downloadable_product_permissions
wp_wc_order_coupon_lookupwp_woocommerce_log
WooCommerce Tables in Database
WooCommerce Tables in Database

Select table and go to “Operations” tab in phpMyAdmin. Click on “Delete the table (DROP)” option and confirm the prompt to delete the table and content.

Delete Table from Database

6. Delete Files

The last step is to delete all residual files left over 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 those WooCommerce files from your server.

Final Words

Many users simply delete WooCommerce plugin from admin panel and assumes that is enough. Unfortunately, it is not and you have to manually remove all the traces. Leaving the residual database tables and file content will continue to impact the size and loading speed of your site. Good thing is that you have a quick option to add an entry in wp_config.php file to completely get rid of all data when deleting the WooCommerce plugin.

Leave a Comment

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