Remove all WooCommerce categories programmatically

/**
 * Deletes all woocommerce categories or other terms you want
 */
function wpm_delete_all_terms($taxonomy_name = 'product_cat'){
	$terms = get_terms( array(
		'taxonomy' => $taxonomy_name,
		'hide_empty' => false
	) );
	foreach ( $terms as $term ) {
		wp_delete_term($term->term_id, $taxonomy_name);
	}
}

Get in touch!

Send us a message, we are
happy to provide assistance or a project quote.