My query is as below $querydetails = " SELECT wposts.* FROM $wpdb->posts wposts INNER JOIN $wpdb->postmeta wpostmeta ON wposts.ID = wpostmeta.post_id INNER JOIN $wpdb->term_relationships yprelation ON yprelation.object_id = wposts.ID INNER JOIN $wpdb->term_taxonomy wptaxonomy ON wptaxonomy.term_taxonomy_id = yprelation.term_taxonomy_id INNER JOIN $wpdb->terms wpterms ON wpterms.term_id = wptaxonomy.term_id WHERE wpostmeta.meta_key = 'event_date' AND STR_TO_DATE(wpostmeta.meta_value, '%d-%m-%Y %H:%i:%s') >= NOW() AND (wposts.post_status = 'publish' || wposts.post_status = 'pending' || wposts.post_status = 'future') AND wposts.post_type = 'events' AND (wpterms.term_id = 5 OR wptaxonomy.parent = 5) ORDER BY STR_TO_DATE(wpostmeta.meta_value, '%d-%m-%Y %H:%i') LIMIT 0,10"; I want to convert this query into wp_query, I have tried below code $custom_query_args = array( 'post_type' => 'events', 'post_status' => array('publish', 'pending', 'future'), 'posts_per_page' => 10, 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'event_date', ) ) ); $query = new WP_Query( $custom_query_args ); but did not get expected results please help