7. Aug 2023 |

WPML and WP-CLI – how to delete products

Whey I tried to delete products using WP-CLI then products only in default language were deleted. Products in other languages could not be deleted using wp post delete. I used the following command:

wp post delete $(wp wc product list --user=1 --format=ids --per_page=10) --force

More information about deleting WooCommerce products using wp-cli can be found there.

In order to delete products in all languages this needs to be checked: WPML → Settings → “When deleting a post, delete translations as well”.

Leave a Reply

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.