Relationships, taxonomy and users
Old systems link records by their own IDs. CAFE never assumes those equal WordPress IDs: every link is resolved.
Post Object, Page Link, Relationship
| The source holds | Use |
|---|---|
The old ID of a record another migration imported (agent_id = 7) |
Old ID → imported post, term or user, with the source key of that migration (legacy-agents). Import the linked records first. |
A list of old IDs ("4,9,12" or [4,9,12]) |
Split text into a list (for text), then Old ID → imported post: the list stays in order |
A slug of an existing post (villa-sunset) |
Post by slug or ID |
| A real WordPress post ID | nothing: CAFE checks that the post exists |
Example: old_related_ids = "2,3" → related_properties (Relationship): Split text
into a list → Old ID → imported post (source key legacy-properties). The
relationship keeps the order B, C.
Linking records of the same migration (property → related properties) works when the referenced records were imported before: run the migration twice, or order the source so referenced records come first.
Taxonomy fields and post terms
- Taxonomy CAFE field: Term by slug, name or ID (taxonomy option) → term IDs.
- Terms of the post (Terms: Categories target): the same transformation; the post's terms are replaced by the mapped ones.
- Terms are never created by a lookup. Create them first, for example with a migration that imports into Terms (name, slug, description, parent).
User fields and users
- User CAFE field: User by e-mail, username or ID. Users are never created.
- Importing into users updates existing users only. Find them by e-mail or username (map the source field to E-mail (finds the user) / Username (finds the user); those two are used to find the user and are never changed). You can set display name, first and last name, nickname, biographical info, website, and CAFE user fields.
- On multisite, only users of the current site are found.
WPML
With WPML active, posts get two more targets:
- Language: a language code of the site (
nl,en…); - Translation of: the source ID of the original record in the same migration.
Import originals before their translations (source order). The new post is connected to the original's translation group with WPML's own API. Fields set to Copy on a translation are written to the original, exactly as when editors save; lookups show translated posts and terms as CAFE always does.