Check if meta key value already exists
Just do a query with WP_Query using the Custom Field parameters (meta_query) to look for posts with the meta key and the value – exemplary code: // args to query for your key $args = array( ‘post_type’ => ‘your_post_type’, ‘meta_query’ => array( array( ‘key’ => ‘videoid’, ‘value’ => $new_posts_videoid // for example: ‘111’ ) ), … Read more