SQL query to check whether a meta key is set or not for a post in post_meta table
Pure SQL questions are off-topic but beyond that, pure SQL is dangerous because it may break if the WordPress Core changes the database structure. You are better off using Core tools where possible. In this case, WP_Query can do what you need. $args = array( ‘post_type’ => ‘post’, ‘meta_query’ => array( array( ‘key’ => ‘status’, … Read more