Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s not clear to me what your intention is. If you mean replicate taxonomy terms assigned to a post into a similar CPT, that can be done. But you say “all the data” into a (singular) CPT. Let’s assume it’s possible for the time being. What would this data structure look like when the migration is complete?

    Thread Starter elfigos

    (@elfigos)

    I have many terms on wp core tag that I want to copy and paste to a new cpt. The structure will be similar, I just want a new term on cpt (with the same title as the copied tag) for each tag.

    Moderator bcworkz

    (@bcworkz)

    Do you mean new taxonomy with same terms instead of new CPT by chance? You could replicate all tag terms in a new taxonomy. You can assign terms from either taxonomy to various post types, but how would the migration code know which terms to assign in each case? There would need to be some kind of post to post relationship established.

    Or do you mean you want to make CPT posts with the same titles as all of your tag terms? In this case you query for all tag terms. Loop through the results. For each term build a post data array for use with wp_insert_post().

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Migrate Taxonomy’s data into Custom Post Type’ is closed to new replies.