ACF Relationship and Post Object fields store post IDs. A spreadsheet doesn’t know the IDs of your site, and the IDs of another site are useless here. Import Export by RockStarLab lets you fill these fields from a CSV file with the titles, slugs or links of the posts, even posts that are created by the same file.
Free: importing posts with ACF fields is in the free plugin. Use version 2.2.1 or newer: it also finds drafts by their slug.
The fields and the file
Our site has an ACF field group Trail Guide on posts with two fields:
- Related Guides (
related_guides): a Relationship field that allows posts. - Visitor Info Page (
visitor_info_page): a Post Object field that allows pages.
The file adds three trail guides. Each names its related guides and its info page in a different way:

- Titles separated by
|:Riverside Weekend Guide|Lake Shore Walk. Lake Shore Walk is the next row of the same file. - A title of an earlier row:
Ridge Loop Trail. - Slugs separated by commas:
ridge-loop-trail, lake-shore-walk. - The page by its title:
Riverside Visitor Information.
Post IDs and full post URLs work too.
Step 1: Upload and map
Open Import Export → Import, choose Posts, upload the file and click Auto Map. Columns named like the field labels go to the ACF fields (acf_related_guides, acf_visitor_info_page):

If a column has another name, drag it to the ACF field in the WordPress fields list.
Step 2: Import
Click Next Step and Start Import. Our 3 posts were created in a second. Without a Status column they are drafts, which is a good way to check them before publishing.
Step 3: Check the fields
Open a post. The Trail Guide box of Forest Canopy Path, whose file row gave two slugs, lists both guides and the info page:

The other two guides got their related posts as well, including Lake Shore Walk, which did not exist yet when the first row was imported: the plugin remembers such references and fills them in when the post is created.
How names are matched
- An ID is used when that post exists and has an allowed post type.
- A URL is matched to the post with that address.
- Otherwise the value is looked up as a slug, then as a title. Drafts have no slug yet, so their slug is worked out from the title.
- Only the post types allowed in the field settings are searched. A Visitor Info Page field limited to pages doesn’t pick a post with the same title.
- A Relationship field and a Post Object field with Select Multiple take several values separated by
|or commas. Use|when titles contain commas. - A value that matches nothing leaves the field empty. If the post is imported later, the field is filled in then.
Tips
- Titles must be unique. If two posts have the same title, use slugs or IDs.
- Update existing posts. To set the fields of posts that already exist, add a column with the slug or ID, set Check for Existing Items by Field to it and If Match Found to Update.
- Between sites. To move posts with their relationships to another site, see ACF relationship fields that break after an import.
An import creates and changes posts. Back up the site first, or ask your AI agent to start the backup.
With an AI agent
An AI agent connected to the site through the WordPress MCP Adapter (see connecting Claude Code to WordPress) can run the same import:
Without the plugin, WordPress 7.1.5 gives a connected agent only three read-only abilities for site, user and environment information. The exports, imports and syncs in the requests below are abilities of Import Export by RockStarLab.
With Import Export by RockStarLab, import trail-guides.csv as posts. Put Related Guides and Visitor Info Page into the ACF fields.
In our run, the agent loaded the file with rsl-ie/upload-from-url and called rsl-ie/import-start with the columns mapped to acf_related_guides and acf_visitor_info_page. Job 100 created the three guides, each with its related guides and the info page, including the two found by slug.
FAQ
Do I need ACF PRO?
No. Relationship and Post Object fields are in the free ACF plugin, and the import works with both.
Can a Relationship field point to WooCommerce products?
Yes, when the field allows the product post type. Product names, slugs or IDs work the same way.
What happens with a name that matches nothing?
The field stays empty for that value, and the import doesn’t fail. Check the spelling, or use the slug.
Related Guides
- ACF Relationship Fields Break After Import? How to Fix the IDs
- How to Import ACF Fields into WordPress: Repeater, Flexible Content and Images
- Import Only Some Posts from a WordPress XML (WXR) Export File
Get the free plugin on WordPress.org.

Comments 0
Have a question or a tip to share? Leave it below.