Eliminar todas las categorias de un producto php woocomerce, eliminar todos los terms de un product

$terms = get_the_terms($product_id, 'product_cat');
foreach($terms as $term){
    wp_remove_object_terms($product_id, $term->term_id, 'product_cat');
}