// Place this into a custom plugin or into your functions.php function custom_events_query($query) { // Check if we're on the main query and it's the archive for 'events' custom post type if (!is_admin() && $query->is_main_query() && is_post_type_archive('events')) { // Set the meta query to only show events from today's date onward $meta_query = array( array( 'key' => 'event_start_date', 'value' => date('Ymd'), 'compare' => '>=', 'type' => 'DATE' ) ); // Set the query to order by the event_start_date meta field $query->set('meta_key', 'event_start_date'); $query->set('orderby', 'meta_value'); $query->set('order', 'ASC'); $query->set('meta_query', $meta_query); } } add_action('pre_get_posts', 'custom_events_query');