• 0

    I build a site with an advanced real estate search via ajax. The search works fine. But when there are more than seven meta_queries, the query really slows down extremly.

    I did some speed tests. Using 7 meta queries: 3 seconds, 8 meta queries: 22 seconds, 9 meta queries: 36 seconds.

    This is the code I am using for adding the real estate options to the query.

    if (null !== ($_POST['du']) && $_POST['du'] != 0) {
       $args['meta_query'][] = array(
           'key' => 'badezimmer',
           'value' => sanitize_text_field($_POST['du']),
           'type' => 'numeric',
           'compare' => '>='
       );
    }

    Is there something I can do to optimize the speed?

    Thanks!

    • This topic was modified 3 years, 4 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 1 replies (of 1 total)
  • Buy a better, faster host?

    There’s a limit to what you can expect from any single web host. you might run the database on one host with WordPress on a second host.

Viewing 1 replies (of 1 total)
  • The topic ‘WP Query slows down extremly when using more than 7 meta_queries’ is closed to new replies.