I have a custom post type that I imported about 12K records for directly into the database. If I look in the "posts" table there is a field called "post_type" that correctly identifies my CPT. My question is, can I add a second post type for another CPT to the same entry so I don't have to import the same 12k records again? My guess is comma-separating them in the "post_type" field will not work. Any thoughts? Thank you.
0
votes
1 Answers
0
votes
No, you can't just comma separate them. WordPress' Custom Post Types take a string as the post_type slug when being registered. If you added a comma in there, the post type would be "this,that" not ["this", "that"].
What you're looking for is using Taxonomies (see also: Categories, Tags & Custom Taxonomies)
Using a custom taxonomy will allow you to categorically combine/sort custom post types based on whatever definitions you're looking for. Depending on what your post type is, you may want to consider renaming it to something that contains both "post_type_1" and "post_type_2" (since you're trying to combine them) and use those labels as taxonomies, or terms within a single taxonomy.