SQL only in custom WordPress post for tag conversion

1

Let's say that a site using WordPress has half the posts of the standard type, and the other half uses a Custom Post Type "review" .

But this type of post had no registered tags, so it shared those of the standard posts (post_tag).

After the custom tag is assigned to the custom posts, it then uses "review-tag". How can I via SQL convert the default tags only within those custom posts to the new type?

This command, for example, converts ALL tags:

UPDATE wp_term_taxonomy SET taxonomy='review-tag', parent=0 WHERE taxonomy='tag';

But I need to do this only with review posts.

    
asked by anonymous 31.12.2014 / 00:37

1 answer

1

Take a look at the link below to understand the relationship between tables:

link

You need to join the wp_posts tables with wp_term_relationships and then the wp_term_taxonomy table to be able to filter by post_type="review" and know which taxonomies to change.

Anyway, I think it will be simpler, and less risky, to make this change for wp-admin itself.

    
02.01.2015 / 03:54