Home Forums Add-ons Repeater Field Programmatic create repeater field


Programmatic create repeater field

  • I want to use repeater fields for my clients application.
    The only problem is, that it already has a pretty big DB that needs to be transferred.

    How can I create the repeater fields programaticaly ?

  • Hi @hannit

    Are you talking about importing data into WP including the repeater field?

    There is a PW plugin which can handle this for you!


  • Nope.
    My base site is not WP, I’m migrating it into WP and want to use repeater fields.

    I need to migrate the data from the old site to the new one, wich will be done programatically. So I need to assign data to these repeater fields using progamatic API.

    How can I do that?

  • Hi @hannit

    Thanks for the follow up.

    ACF contains a simple function called update_field. You can read about it here:

    To save the repeater field, you will need to save the $value as a multidimensional array.

    The $value will be an array where each piece is another array. This represents each row.

    In each row array, you will need to define the sub field values. This can easily be done using the sub_field name as the key, and the sub_field value as the value.


  • Hello @elliot

    Thank you for the excellent products!

    I have been looking at as many resources as I can find online, trying directly calling update_field() as well as using acf/load_value, but I cannot seem to set a repeater field on a newly created page (all in code). Do you have any code snippets wherein a page is created and then an acf repeater field is successfully populated and then read back?

    Thank you

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

The topic ‘Programmatic create repeater field’ is closed to new replies.