Setting primary category for products
-
Hi,
I need to set several primary categories for a large number of products. For such purpose I have used a code with
update_post_meta( $product_id, '_yoast_wpseo_primary_product_cat', $primary_category_id );
inside a block hook like woocommerce_update_product and save_post.
However, such code is not updating the primay category for any product. I have also used a direct database update, but also did not worked.
Is there any limitation and/or an alternative method to deal with this?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.