Prevent duplicate posts in wp_insert_post using custom fields
To save the link in the post meta you can use update_post_meta like this for example: $url = “http://sample.com/entertainment/default.aspx?tabid=2305&conid=102950” $my_post = array( ‘post_title’ => “$title”, ‘post_content’ => “$content”, ‘post_status’ => ‘draft’, ‘post_author’ => 1, ‘post_category’ => array(1), ); $post_id = wp_insert_post( $my_post ); update_post_meta($post_id,’source_link’,$url); and to prevent the insertion add a simple conditional check: $args … Read more