diff --git a/inc/functions/posts.php b/inc/functions/posts.php index 04b274127d..867be320ca 100755 --- a/inc/functions/posts.php +++ b/inc/functions/posts.php @@ -249,8 +249,13 @@ function rocket_url_to_postid( string $url ) { */ $query = (array) apply_filters( 'rocket_url_to_postid_query_args', $query, $url ); + $query['no_found_rows'] = true; + $query['update_post_term_cache'] = false; + $query['update_post_meta_cache'] = false; + // Do the query. $query = new WP_Query( $query ); + if ( ! empty( $query->posts ) && $query->is_singular ) { return $query->post->ID; } else {