diff --git a/search/includes/classes/class-health.php b/search/includes/classes/class-health.php index bf8eb5c150..d00c2ac26c 100644 --- a/search/includes/classes/class-health.php +++ b/search/includes/classes/class-health.php @@ -181,6 +181,11 @@ public function get_index_entity_count_from_elastic_search( array $query_args, \ // Since the user indexable is global, we want to include ALL in count. unset( $query->query_vars['blog_id'] ); } + + // An improperly formatted ES args filter can break the `wp vip-search health validate-counts` CLI. + remove_all_filters( 'ep_formatted_args' ); + remove_all_filters( 'ep_post_formatted_args' ); + $formatted_args = $indexable->format_args( $query->query_vars, $query ); // Get exact total count since Elasticsearch default stops at 10,000.