Home Forums ACF PRO Edit multiple post at once using acf_form


Edit multiple post at once using acf_form

  • Hi,
    I’m looking for a way to edit multiple posts fields in front end using acf_form.
    For now I’ve created a front end form and set the form parameters to false as mentioned in this thread :

    But only my last post is saving.

    Here is my code :

    <form id="acf-form" class="acf-form" action="" method="post">
        <div class="table-responsive">
            <table class="table">
                        <th class="accreditation">Accréditation</th>
                <?php $args = array(
                    'post_type' => array( 'evenement' ),
                $evenements = new WP_Query( $args );
                if ( $evenements->have_posts() ) {
                    while ( $evenements->have_posts() ) {
                        $evenements->the_post(); ?>
                    <td><?php the_title(); ?></td>
                    <?php $options = array(
                        'field_groups'	=> array('group_5aafe1f54cc6c'),
                        'updated_message' => false,
                        'post_id' => $post->ID,
                        'form' => false,
                    acf_form( $options ); ?>
                <?php }
                wp_reset_postdata(); ?>
        <div class="acf-form-submit">
            <input type="submit" class="acf-button button button-primary button-large" value="Mettre à jour">
            <span class="acf-spinner"></span>
  • The problem is that all the fields have the same names/keys, so you have multiple input fields with the same name. The later fields of a name overwrite the earlier fields with the same name. For this reason, editing multiple posts with the same fields will not be possible using acf_form().

  • Ok thanks for the explanation, is there a way to save fields without reloading page ?

  • Thanks @hube2 !
    That topic helped me.

    I was wondering if I could automatically update field without clicking on the update button. This way, each time a field is edited, it’s updated by ajax automatically.

    This would solve my problem and avoid client to forget pressing button when editing multiple post.

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

The topic ‘Edit multiple post at once using acf_form’ is closed to new replies.