Background of the issue:
I am trying to resolve a WordPress database error related to WPML on my website. My error logs are filled with the following error: [15-Sep-2025 05:57:16 UTC] WordPress database error Commands out of sync; you can't run this command now for query SELECT element_id, language_code FROM wp_icl_translations WHERE trid = (SELECT trid FROM wp_icl_translations WHERE element_type = 'post_page' AND element_id = (SELECT option_value FROM wp_options WHERE option_name='page_for_posts' LIMIT 1)) made by shutdown_action_hook, do_action('shutdown'), WP_Hook->do_action, WP_Hook->apply_filters, LiteSpeedCore->send_headers, LiteSpeedControl->finalize, LiteSpeedMetabox->setting, get_option, apply_filters('pre_option_page_for_posts'), WP_Hook->apply_filters, SitePress->pre_option_page_for_posts, WPML_Pre_Option_Page->get. Initially, I suspected the issue was due to Litespeed, but their support confirmed it is related to WPML.
Symptoms:
WordPress database error: Commands out of sync; you can't run this command now.
Questions:
How can I resolve the WordPress database error related to WPML?
What steps should I take to troubleshoot this issue without using direct chat support?
Reviewing this query it looks like another query left the database in a shutdown state, and it does not necessarily look like a bad query coming from WPML.
If possible, please try the following and let me know your results.
1. Temporarily deactivate LiteSpeed Cache and clear any server-side cache/Redis/Memcached.
2. update WPML and it's add-ons to their latest versions.
Go to plugins->Add new->commercial tab and click on "check for updates"
3. Run the WPML troubleshooting actions
In WPML → Support → Troubleshooting, run (in this order): Clear the cache in WPML, Set language information, Fix post types assignment, Remove ghost entries, and Synchronize posts taxonomies. These don’t delete content and often clear translation-table edge cases
If the issue persists, Go in your wp-config.php file and look for
define(‘WP_DEBUG’, false);. Change it to:
define('WP_DEBUG', true);
Edit your wp-config.php file and add these lines, just before it says 'stop editing here':