简体   繁体   中英

WordPress WooCommerce move post tags to products tags

Is there a way (mySQL, Plugin etc) to move all the post tags to product tags . The junior created 50+ products and tags as posts instead of products. I have successfully moved the posts but I need to move all of the tags.

To convert Post Tags to Product Tags you need to change the taxonomy related to that terms.
You can move all Post Tags to Product Tags with that SQL query:

UPDATE `wp_term_taxonomy` 
SET `taxonomy` = 'product_tag' 
WHERE `wp_term_taxonomy`.`taxonomy` = 'post_tag';

You can also use this query with $wpdb object methods in a custom function that you will run once.

您只需在数据库中将分类类型从“ post_tag”更改为“ product_tag”即可。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM