MySQL server version for the right syntax to use near ‘OPTION SQL_BIG_SELECTS = 1


Some times there is troubles with version of MySQL versions on your server, and its generates next error:

"WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_BIG_SELECTS = 1 /* From [XXX' at line 1 for query SET OPTION SQL_BIG_SELECTS = 1 /* From [XXX] in [/site_path/wp-content/plugins/meta-data-filter/views/shortcode/meta_data_filter.php:208] */ made by require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts, do_action_ref_array, call_user_func_array, MetaDataFilter::pre_get_posts, do_shortcode, preg_replace_callback, do_shortcode_tag, call_user_func, MetaDataFilterShortcodes::do_meta_data_filter_shortcode, MetaDataFilterCore::render_html, include('/plugins/meta-data-filter/views/shortcode/meta_data_filter.php')"

In such case do next please:

  • open next file of the plugin: /views/shortcode/meta_data_filter.php
  • find there code: $wpdb->query('SET OPTION SQL_BIG_SELECTS = 1') and remove OR comment this code line