I got this error message in the apache.error.log of my site. Usually I get a clue because the path to a plugin is shown in the message.

But, in this error, no plugin is mentioned. The my question is: how can I start to trace the cause of this error message.

Besides, I don't know how this error was fired, then I have no idea how to reproduce it.


[Tue Dec 05 19:41:27.165722 2017] [proxy_fcgi:error] [pid 29936] [client] AH01071: Got error 'PHP message: 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

')  GROUP BY t.term_id ORDER BY tm.meta_value+0 asc, t.name ASC' at line 4 of Wordpress database for the query SELECT  t.*, tt.*, tm.meta_value FROM wp_terms AS t  INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id LEFT JOIN wp_icl_translations icl_t\r\n                                    ON icl_t.element_id = tt.term_taxonomy_id\r\n                                        AND icl_t.element_type IN ('tax_product_cat') INNER JOIN wp_term_relationships AS tr LEFT JOIN wp_termmeta AS tm ON (t.term_id = tm.term_id AND tm.meta_key = 'order')  WHERE tt.taxonomy IN ('product_cat') AND ( ( icl_t.element_type IN ('tax_product_cat')  AND icl_t.language_code = 'es'  )\r\n                                    OR icl_t.element_type NOT IN ('tax_product_cat') OR icl_t.element_type IS NULL )  AND tr.object_id IN ()  GROUP BY t.term_id ORDER BY tm.meta_valu...\n'

, referer: http://www.example.com/

  • Usually mysql errors are a PITA to debug in WordPress .. As this one is about syntax, maybe it is because a theme/plugin author uses $wpdb->query directly instead. greping for that or $wpdb inside /wp-content could provide some clues
    – kero
    Dec 7, 2017 at 11:38
  • This actually seems to join the WPML tables. Maybe the php log can show you more Dec 7, 2017 at 14:59

1 Answer 1


To help debug, consider what was the most recent change to the website right before you noticed this error. Were there any new plugins installed, was WordPress upgraded, anything updated, modified or deleted in the theme and plugins?

Normally it is recommended to make a clone of the site and test with that (or if you want to make a change with the live site... make a back-up first) Then disable one plugin at a time and see if the error goes away. That will help pinpoint the trouble maker.

** Very important, before debugging any error on a site, if you have any caching plugins, then disable it first. Cached pages can really throw you off.

Also, if you have SEO plugins, I suggest disabling those next. They usually interfere with the WordPress themes and normally could create trouble.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.