Bulk Deleting Products in WooCommerce After Dropping WPML

In a recent Business Bloomer Club Slack thread, a user shared their experience with handling a multilingual WooCommerce store set up using WPML. This store hosts 13,000 products each in French and Dutch, creating a massive catalog for the site to manage.

However, due to various challenges and slowdowns associated with WPML, the user decided to drop the plugin. While WPML is a popular solution for multilingual WooCommerce stores, it can become complex, especially in high-volume product catalogs where discrepancies like inconsistent stock levels or mismatched prices between language versions are common.

The user’s objective now is to remove the French products entirely from the store without impacting the remaining Dutch catalog. They sought advice on the most efficient and error-free way to accomplish this task, knowing that careful bulk deletion is necessary to prevent database inconsistencies.

Here’s a look at some methods discussed, including manual deletion, SQL queries, and selective exporting and re-importing.

Options for Bulk Deleting WPML Products

Using WordPress Admin Bulk Actions

One straightforward method is using WordPress’s built-in bulk actions. Here’s how to efficiently delete products in bulk:

  • Set Bulk Actions Screen Settings
  • Navigate to WooCommerce > Products.
  • Adjust the screen settings to display as many products per page as your server allows (often up to 1000).
  • Select all products on the page and use the “Move to Trash” option from the bulk actions dropdown.
  • Repeat Across All Pages
  • This may be time-consuming for a large product count, but it provides a direct way to delete products page by page.

SQL Query for Language-Specific Deletion

If you’re comfortable with SQL, you can filter out products based on language directly from the database. WPML often stores language IDs in a separate table, so you might be able to use an SQL query to delete only products in French:

  • Access Your Database using phpMyAdmin or a similar tool.
  • Run a Filtered Query that deletes products identified by the French language ID in WPML’s tables. This Stack Overflow post offers guidance on WPML-specific queries.

Export, Delete, and Re-Import NL Products

Another method is to use the export and re-import process selectively for Dutch products:

  • Export Dutch Products: Use a plugin like WP All Export to back up all Dutch products.
  • Delete Product Tables: Remove all product-related database tables, which will clear out both languages.
  • Re-Import Dutch Products: Use the export file to re-import only Dutch products, ensuring a clean setup without French content.

This approach carries some risk, so testing it first on a staging site is recommended.

Final Thoughts

Transitioning away from WPML on a WooCommerce site with a large catalog is a significant change, but it can improve site speed and usability. Testing each step in a staging environment will help ensure a smooth transition without impacting the live store’s performance or data integrity.

Related content

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

Reply

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