Multiple postmeta with same name for one post in wp_postmeta table
wp_insert_post runs whenever a post is updated, not just when it’s first saved. So your payment_meta() function is running every time a post is saved, and since you’re using add_post_meta() in that function, a new meta entry is created every time the post is saved. Instead of using add_post_meta() stick to just using update_post_meta() if … Read more