Title: Import posts with relations
Last modified: December 3, 2020

---

# Import posts with relations

 *  [squatter1](https://wordpress.org/support/users/squatter1/)
 * (@squatter1)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/import-posts-with-relations/)
 * Hello,
    I would like to ask, if it is possible to do following:
 * I have two post types: artists and exhibitions.
 * Each exhibition has 1 to n artists and each artist has 1 to n exibitions.
 * Now I have two csv files – artists.csv and exhibitions.csv. I would like to import
   them into wordpress.
 * Each artist or exhibition has his unique id in the csv.
 * How do I connect artists with exhibitions and exhibitions with artists via advanced
   custom fields?
 * Also I have to be able manually connect exhibitions and artists after the impor
   in wp admin.
 * I have set up custom fields exhibition_id and artist_id to each entry.
 * Thanks for suggestions.

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/import-posts-with-relations/#post-13743228)
 * It’s difficult to manually enter multiple meta values in a single field in a 
   way that’s usable for queries. (for example, all artists in a group exhibition’s
   artist_id field) I recommend implementing one of the objects as taxonomy terms
   assigned to the other. Then you can easily get all artists for an exhibition 
   or all exhibitions for an artist, as well as many to many sort of relations.
 * There are fewer fields for taxonomy terms than posts, but term meta is supported,
   so all relevant data can still be saved with the term. If you must use post types
   for both, I’d still implement a taxonomy and relate one of the post objects to
   its taxonomy term through either post or term meta. Just don’t do both or an 
   internal discrepancy between relations could develop.

Viewing 1 replies (of 1 total)

The topic ‘Import posts with relations’ is closed to new replies.

## Tags

 * [ACF](https://wordpress.org/support/topic-tag/acf/)
 * [csv](https://wordpress.org/support/topic-tag/csv/)
 * [Import](https://wordpress.org/support/topic-tag/import/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/import-posts-with-relations/#post-13743228)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
