Delete a custom field in mysql for all posts with specific category id

Please try with below code : $pro_args = []; $pro_args[‘post_type’] = ‘post’; //Replace your post type $pro_args[‘post_status’] = ‘publish’; $pro_args[‘posts_per_page’] = -1; $pro_args[‘tax_query’] = array( array( ‘taxonomy’ => ‘category’, //Replace your taxonomy name ‘field’ => ‘id’, ‘terms’ => array( 66 ), ) ); // Optional $pro_args[‘meta_query’] = array( ‘relation’ => ‘AND’, array( ‘key’ => ‘key1’, … Read more

One of two similar WP Query is very slow

It is likely there are very few rows WHERE AND ( wp_posts.post_date >= ‘2019-09-04 21:45:00’ ) there are likely many thousands of rows WHERE AND ( wp_posts.post_date < ‘2019-09-04 21:45:00’ ) and a table scan is required. EXPLAIN SELECT SQL_NO_CACHE remainder of query for each and examine results carefully. Post the TEXT RESULTS of EACH … Read more