Some products are sold seasonally, and site owners may need to update their catalog to reflect current offerings. Products no longer available or relevant might need to be removed to keep the catalog current and accurate. Products can be deleted during import using the Product Import and Export plugin. The products not present in the import CSV file are deleted from the site.
Use case
The CSV file and the products to be deleted are shown below. As a use case, the Product Scale present in the store will be deleted. Remove the product Scale that is no longer available for sale from the import file and import the file
Steps to delete non-matching WooCommerce products
- From the dashboard, go to WebToffee Import Export (Pro) > Import. The plugin will take you through the import process.
- In Step 1: Select a post type, and select Product.
- Specify the import method and file name in Step 2: Select an import method.
- Map the required import columns in Step 3: Map import columns.
- In step 4, enable the option Delete non-matching products from store. This option, when enabled, will delete the products present in the store but not in the CSV.
- To delete products not in the CSV and belonging to a specific category, add the code snippet below to the active child themes function.php file.
- Finally, click the Import/Schedule button to delete the non-matching products from the store.
The Image shows the product Scale deleted from the site. The store will no longer have this product for sale.