How to Import Advanced Custom Fields (ACF)
WP All Import and the ACF Import Add-On allow you to import data to any Advanced Custom Fields (ACF) added to your post type or custom post type.
The ACF plugin extends WordPress's basic functionality to enable more complex fields, different layouts, and settings. Using our integration with this plugin, you can avoid adding that data manually and just import everything.
Importing Advanced Custom Fields with WP All Import and the ACF Import Add-On is as easy as importing normal custom fields.
Here’s how it works:
- Create your field group and add all of your fields via the ACF plugin.
- Make sure WP All Import and our ACF Add-On are active.
- Go to All Import › New Import and start a new import of the post type where you added Advanced Custom Fields.
- In Step 3, you'll see the Advanced Custom Fields Add-On section to import the previously added fields:
Continue reading below to see step-by-step instructions on how to import Advanced Custom Fields using the ACF Import Add-On and WP All Import Pro.
Step 1: Create a New Import for Advanced Custom Fields
Navigate to All Import › New Import and provide a valid import file. Then, choose from the drop-down list the post type that has the Advanced Custom Fields attached.
In this example, we're importing ACF fields to Posts.
Click Continue to Step 2 to move on to the next step.
Keep in mind that your Advanced Custom Fields and Fields Groups need to be previously created and defined for posts in the ACF plugin.
If you're not certain how to create the field groups, please review How to Create ACF Fields Groups in the Advanced Topics section below.
Step 2: Review Import Data
Now the Review Import File interface appears. Here you can review and confirm that the import data looks correct:
The import has detected 100 records to import. To make sure that the data is correct, you can review each record with the gray arrows at the top.
In this step, you can Add Filtering Options if they are needed.
This example uses a CSV spreadsheet. If you import an XML or Excel file, you can decide which will be the main node to import.
Once you confirm that the data looks good, click Continue to Step 3.
Step 3: Map Incoming Data Elements to their Correct Advanced Custom Field
The Drag & Drop interface appears here. It allows you to map the data elements to their respective target fields.
To map the data, locate the desired import element in the panel on the right, then drag that element to its corresponding field on the left.
The Advanced Custom Fields Add-On section is where you define the ACF fields to import.
Locate that section by scrolling down and then enable the field group to import:
You can map each individual Advanced Custom Field as required:
Once all of the relevant data elements are mapped to their target fields, click on Continue to Step 4 at the bottom to move to the next step.
Before proceeding, make sure that you map all other fields related to the post type or custom post type that you're importing.
Step 4: Configure Remaining Settings and Run Import
The Import Settings interface is where you configure the remaining import settings and other options:
Specifically, you need to define a Unique Identifier for the import. WP All Import uses the unique identifier to keep track of imported records. To create it, simply click on Auto-detect.
You can also define this unique identifier by manually dragging and dropping fields from the right.
Here you can modify the import behavior whenever it's run again (to update, delete, or create new records found on the import file). You can set up Scheduling Options and Configure Advanced Settings. With most imports, there's no need to modify any of these settings.
Click the blue Continue button at the end to move to the next step.
Step 5: Verify Imported Data and that the Advanced Custom Fields Were Created Correctly
Next, you see the Confirm & Run interface. In the Import Summary section, you can review the import, what's the import file, and other import settings.
Click the green Confirm & Run Import button to execute and run this import.
When it completes, you will see the Import Complete screen:
That's it! The import correctly processed the posts and ACF fields from this example.
You can review the imported fields by checking any of the imported posts in Posts › All Posts.
Import Advanced Custom Fields Advanced Topics
How to Create ACF Field Groups
Every Advanced Custom Field that exists on your site is part of a Field Group. A Field Group is the method used by the ACF plugin to attach fields to post types or custom post types. Each field group has a title, fields, location rules, and visual settings.
Here's what you need to do to add field groups:
- Go to Custom Fields › Field Groups.
- Click on Add New at the top.
- Input a title for the field group
- Add the desired Advanced Custom Fields by using the + Add Field button.
- Define where these fields will show by setting a Location.
- Click Publish to create the new field group.
Import to Repeater Advanced Custom Fields
The ACF Import Add-On offers three different ways to import ACF repeater data:
- Fixed Repeater Mode: used when each piece of the repeating data is stored in separated columns or elements.
- Variable Repeater Mode (XML): used when each piece of the repeating data is stored in XML format as a sibling element.
- Variable Repeater Mode (CSV): used when each piece of data is stored in different columns but with multiple data entries that are also separated by a character.
The mode used to import your ACF repeater data will depend on the format provided by your import file.
The ACF Import Add-On was built taking into account that each dataset is different. This allows you full control over your ACF import and enables support for multiple file formats.
To learn more about the different modes available, you can see our in-depth guide on importing Repeater Fields.
How to Import Advanced Custom Fields on Their Own
Unfortunately, this isn't possible since the actual Advanced Custom Fields are attached to a post type or custom post type on your site.
This means that, as explained in this guide, you need to import data into the specific post type or custom post type where the fields are attached.
WP All Import and the ACF Import Add-On can import data to the fields, but they cannot import the actual fields (in other words, it's not possible to create the fields while importing).
To import (or export) the ACF Field Groups themselves, use the options found in Custom Fields › Tools.
Frequently Asked Questions
How Do I Export Advanced Custom Fields?
You can export Advanced Custom Fields using WP All Export and the ACF Export Add-On. Here's what to do:
- Navigate to All Export › New Export and select the post type with attached Advanced Custom Fields.
- Add the desired ACF fields that you want to export.
- Generate the export file and download it.
To learn more, please see How to Export Advanced Custom Fields (ACF).
How Do I Add a Custom Field in ACF?
You can add an Advanced Custom Field to an existing field group like so:
- Locate the field group where you want to add this custom field in Custom Fields › Field Groups.
- Click on Edit.
- Here you can add the new Advanced Custom Field to this field group by clicking on + Add Field and configuring the new field.
- Once done, click on Update to save the changes.
How Do I Add Advanced Custom Fields in WordPress Programmatically?
While you can use ACF functions to import Advanced Custom Fields programmatically, we recommend using WP All Import and the ACF Import Add-On, as explained in this article.
When importing, you can use the pmxi_acf_custom_field filter from our Action Reference. That filter allows the modification of the Advanced Custom Field values.
Learn how to import correctly into ACF repeater fields.
Execute PHP or custom code to modify ACF data during import.