I was wondering what the recommended method is for importing custom post types that contain ACF fields. Ideally I was this to be via a CSV since my client is a lot more comfortable with a spreadsheet rather than XML. The posts also have around 30 fields, so ideally something that is configurable and remembers field mappings so we dont have to re-map every time we import.
Cheers for the advice. I have found http://www.wpallimport.com/ but it seems it doesn’t deal with multi select items, or associating images due to the way ACF stores its values. I dont suppose you know of any resources in particular regarding importing to ACF? I’m not finding a whole lot of options at the moment.
Thanks for your help
I’m sure the plugin would offer some actions / filters to allow you to customize the save action for each row. You could use these to handle the multiple value fields.
ACF expects multiple values to be saved as an array. You can use the update_field function to handle the insert
Hi. Anything new on this?
I face a similar problem. I have a custom post type, and that custom post type has fields in ACF. I also have ~1 thousand entries in a spreadsheet, with headers that correspond to WP fields (e.g., title, body, categories, tags), as well as ACF fields.
What is a recommended way to import my CSV? For example, so that one of the columns in the CSV is mapped to a specific ACF field?
I actually ended up coding a basic importer that was quite specific to our csv. It does allow for mapping CSV headers against ACF fields, but it isn’t particularly elegant or completely reliable right now. I learned quite a bit whilst doing it and will hopefully be going back to produce something more robust, I think ACF could do with it!
Just thought I would report back.
I found a plugin called TurboCSV ($50) which (with the help of the Chris Richardson the developer) I managed to get to work with ACF.
I had to do quite a lot of testing but I found that if you name the csv column the same name as your ACF custom field, it should map itself automatically when it uploads.
Other than that, the plugin works a dream and is incredibly reliable.
Hope this post is useful to others
@elliot Any plans to develop a csv importer tool specifically for ACF, or even publishing a document on ‘how to’ ?
I’ve noticed that Woo has created an importer for their Woo Commerce product:
Nice price too 😉
I would have no qualms lining your palms with a similar amount 😉
And WP Types explains the ins and outs here:
We have tried, unsuccessfully, using the WP All Import plugin and some of the others seem a bit flaky at best.
Well this is interesting folks, I just looked at the WP All Import site and they have an ACF add on:
It doesn’t seem to included in their purchase page:
And it doesn’t seem to be mentioned in their support docs either.
I guess it’s a start though!
Just came across this post after searching for a solution as well to import CSV into a Custom Post Type with ACF fields in it.
I found this one:
The free version, downloaded from the plugins section works pretty nice, and seemed to allow me to select ACF based posts, but wont import. They say the paid version (which is a bit pricey per domain) will work with ACF based fields. I’ll let you know when I get the pro version installed.. really hoping it works for that price.
@dirtyharry Avoid Smackcoders, it doesn’t support repeater fields and photos.
WPAI has an add-on for ACF and works well but not without a struggle! That said, they seem to have fixed most of the bugs that were causing us problems.
It’s fiddly and clunky to use, so tread carefully!
Thanks everyone this thread has been helpful pointing me in the right direction. I’ve imported data fairly easily using WP All Import, but only by creating multiple posts. What I really need to be able to do is populate a repeater field within a single post with multiple records from my CSV. I’m not sure it can be done – I haven’t heard anything back from WP All Import support yet. Has anyone here had any success importing to repeater fields?
The topic ‘Import Custom Posts via CSV’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2021 Advanced Custom Fields.