D
D
Danil Trubitsyn2021-04-10 11:02:07
WordPress
Danil Trubitsyn, 2021-04-10 11:02:07

How to remove all tags from selected products in Woocommerce?

How to bulk clear tags of Woocommerce products marked in the admin panel without deleting the tags themselves?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2021-04-10
@ali3412

$posts = [5,155,255,855,856] // id продуктов
foreach ($posts as $post ) {
wp_delete_object_term_relationships ($post, 'product_tag');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question