Support

Account

Home Forums ACF PRO Avoid using a foreach() with update_field() Reply To: Avoid using a foreach() with update_field()

  • No there isn’t. ACF uses use update_post_meta() or update_metadata(). Every update requires at least 2 db queries and sometimes 3. This means that it can take 4 to 6 queries to update a single ACF field.

    WP does not supply any way to update more than a single meta value at a time in a single query.

    There is a way, but it would require accessing the database directly and constructing the correct SQL query to do multiple updates or inserts to the correct table in a single query. You would also need to account for both the field value and the acf field reference value as well.