Support

Account

Home Forums Add-ons Options Page Import data to ACF options page

Solving

Import data to ACF options page

  • I created an options page and registered fields via PHP on my functions.php. Now, I would like to import a CSV file to update my fields (several select fields and repeaters. Admin select an option on the first select field, then a second option on the second select field, and then complete repeaters. Every fields have conditional rules).
    I find the WP All Import plugin with ACF extension, but it seem we can only import data on post/page but not options page.
    Do you have a solution ? Maybe with update_field() ?

  • Nobody have a solution to update fields on an options page with CSV ?

  • There are no tools available that can be used to import options.

    There are several ways that you can work around this.

    The first is to use some type of custom post type instead of options.

    The second is that you can define a post ID to use for your options. This is complicated in a way. What you need to do is have a page or post of any kind. When creating the options page you set this posts ID as the post_id for the options page. Then you always import custom fields for the options of this post and you use this post ID instead of “options” when getting the options values from ACF.

    Overall, I would probably go with figuring out how to use a custom post type for this data rather than options.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.