duplicate posts when trying to update a post using the wp_insert_post.

You should insert posts with wp_insert_post and update posts with wp_update_post. wp_update_post will add a revision to the database and update the published/draft post data.

Leave a Comment