WP_Query hit max joins… How else can I build a search function that uses custom fields? April 28, 2022 by Tarik Billa This seemed to do the trick, running it before my WP_Query: $wpdb->query('SET OPTION SQL_BIG_SELECTS = 1');