Support

Account

Home Forums Add-ons Repeater Field update_field() will not remove lines from repeater Reply To: update_field() will not remove lines from repeater

  • If you look at ../advanced-custom-fields/pro/fields/class-acf-field-repeater.php line 812 (function update_value) you will see that ACF gets the old number of rows and makes a comparison after updating and then deletes any access rows.

    Performance wise, updating a repeater with 15 rows of 27 fields will not be faster even if you delete everything first, in fact, deleting everything first will reduce performance. Updating his repeater will mean a minimum of 812 queries. Deleting it first will double this to 1624 queries.

    ACF calls update_metadata() for every field, not just once. each sub field on each row of the repeater is stored separately and each must be updated independently.

    More than likely, the reason that the excess rows are not being deleted is that with this number of queries that need to be performed the request simply times out before it can get to that point. It’s likely failing long before it has even done all of the updates.

    There have been many discussions on this forum about the performance of large repeaters.