How to Import to ACF Repeater Fields
Our ACF Import Add-On for WP All Import provides three modes for importing to ACF repeater fields. The preferred option depends on the type of file you are using, as well as the way your data is structured.
Importing ACF Repeater Data From Several Records
Importing to an ACF repeater field from several records for a single post is not supported. All of the data for a repeater field must be present in the same record.
For example, the data in the “Sizes” column in this file can be imported into an ACF repeater field because it is in the same record:
However, the data in the “Sizes” column in this next file cannot be imported as desired since the data is spread across several records:
Depending on the import settings, either a separate post would be created for each row, or only the “Large” value would be present in the repeater field for “Test Post” (since the values imported immediately beforehand would be overwritten).
Mode 1: Fixed Repeater Mode
Use Fixed Repeater Mode when each piece of your ACF repeater data is stored in separate columns or elements. For example, if you have a repeater field containing an image, and your CSV file has five columns – image_1, image_2, image_3, etc:
Manually add five rows to the repeater field by clicking Add Row:
Then drag & drop image_1 to the first row, image_2 to the second row, etc.
Check the Ignore blank fields box if some of the records in your file don’t contain values for all five images. For example, if image_3 and onwards are blank for a certain record, WP All Import will only add two rows to the repeater for that record.
Mode 2: Variable Repeater Mode (XML)
Use this option if your ACF repeater data is stored in XML format as “sibling” elements, for example:
<images>
<image>image_example_1.jpg</image> <image>image_example_2.jpg</image>
<image>image_example_3.jpg</image>
<image>image_example_4.jpg</image> <image>image_example_5.jpg</image>
</images>
Dragging & dropping won’t generate the correct XPath expressions when using Variable Repeater Mode (XML). You need to modify your XPath expressions as per WP All Import's FOREACH syntax.
If you'd like to learn more, check this video where “Variable Repeater Mode (XML)” is used.
Mode 3: Variable Repeater Mode (CSV)
If your ACF repeater data is stored in a single column in your CSV file and is separated by a separator character, use this option.
For example, if you have an ACF repeater field containing ingredients (Name and Measure – i.e., 1/2 cup is the measure and butter is the name), and the names & measures are stored in separate columns in your CSV file:
Since this repeater data is comma-separated, change the Separator Character setting from a pipe character to a comma and drag & drop the name & measure columns into the appropriate sub-fields in the ACF repeater field. The end result should look like this:
When the ACF repeater data is imported, the first item in the name column will be associated with the first item in the measure column, the 2nd item in the name column with the 2nd in the measure column, etc.
Frequently Asked Questions
How Do I Add an ACF Repeater Field in WordPress?
To add an ACF repeater field in WordPress, go to ACF › Field Groups in the WordPress main menu. This will open the Field Groups page. Click the Add New button in the upper left. Select Repeater as the Field Type and fill out the other field group info. You can then add fields to this group by clicking the Add Field button.
What Add-Ons Do I Need to Import ACF Repeater Fields?
To import ACF repeater fields, you need to have the ACF Import Add-On active on your site along with WP All Import.
Related Docs
Learn how to import Advanced Custom Fields using WP All Import.
Learn more about exporting Advanced Custom Fields with WP All Export.
Shows you how to use PHP functions or custom PHP functions during import.