How do you make a list and list item relation if custom post types?

Here are few ideas how to relate content together in WordPress. Without knowing (and understanding) all the details and requirements it’s difficult to give a complete answer, but these hopefully help you explore different possible solutions.

  1. Store relation data in CPT post meta. You can then use WP_Query with
    meta parameters to find matching posts
  2. Manage relations with post_parent property of WP_Post (it has its own column in DB {prefix}_posts table). Nothing stops you from relating different posts types together like this, if you handle the data saving yourself with wp_update_post()
  3. Create a custom taxonomy to serve as lists and use CPT as items
  4. Use CPT as list and store list items as serialized array / json in the post’s post_content property
  5. Skip CPTs altogether, store everything in custom DB tables and manage data with $wpdb

P.s. please note that these kind of open questions usually don’t have a single definite answer, but recieve many opinion-based answers each with many ifs, buts and maybes, and your question might get closed.

tech