Title: Fix ACF Bidirectional relations
Last modified: August 28, 2026

---

# Fix ACF Bidirectional relations

 *  [followalter](https://wordpress.org/support/users/followalter/)
 * (@followalter)
 * [1 week, 1 day ago](https://wordpress.org/support/topic/fix-acf-bidirectional-relations/)
 * Hi,
 * While working on a project, I found that if you clone a post that had a bidirectional
   connection to another post, the connection was correctly cloned the other post,
   but the connection back wasn’t made. This makes sense since you’re not touching
   that other post. ACF has had this bidirectional option for a while and cloning
   posts that use this, effectively breaks the connection from one side.
 * I wrote a function that hooks into your ‘duplicate_post_post_copy’ and resaved
   any bidirectional ACF field, which correctly creates the connection in both directions,
   fixing this issue. Is this something you’d consider adding to the plugin? Or 
   would you tell me: create your own add-on plugin.
 * This is the function:
 *     ```wp-block-code
       add_action('duplicate_post_post_copy', 'resync_bidirectional_fields_after_duplicate', 20, 2);function resync_bidirectional_fields_after_duplicate($new_post_id, $post){if (!function_exists('get_field_objects')) {return;}$fields = get_field_objects($new_post_id, false);if (empty($fields)) {return;}foreach ($fields as $field) {if (empty($field['bidirectional']) || empty($field['bidirectional_target']) || empty($field['value'])) {continue;}delete_field($field['key'], $new_post_id);update_field($field['key'], $field['value'], $new_post_id);}}
       ```
   

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffix-acf-bidirectional-relations%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/duplicate-post/assets/icon-256x256.png?rev=3581701)
 * [Yoast Duplicate Post](https://wordpress.org/plugins/duplicate-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duplicate-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duplicate-post/)
 * [Active Topics](https://wordpress.org/support/plugin/duplicate-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duplicate-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duplicate-post/reviews/)

## Tags

 * [$post object](https://wordpress.org/support/topic-tag/post-object/)
 * [ACF](https://wordpress.org/support/topic-tag/acf/)
 * [bidirectional](https://wordpress.org/support/topic-tag/bidirectional/)
 * [Relationship](https://wordpress.org/support/topic-tag/relationship/)

 * 0 replies
 * 1 participant
 * Last reply from: [followalter](https://wordpress.org/support/users/followalter/)
 * Last activity: [1 week, 1 day ago](https://wordpress.org/support/topic/fix-acf-bidirectional-relations/)
 * Status: not resolved