Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are encountering a database error on your WordPress site using the WPML plugin, specifically a subquery returning more than one row. This error is linked to a specific SQL query involving multiple conditions and joins.
Solution:
First, ensure you have a backup of your site. Product entry in DB was corrupted. You should fix it by adjusting language informations in the DB.v For example, following SQL command to correct the source language code of mentioned Product ID in your database:

UPDATE wp_icl_translations<br />SET source_language_code = 'en'<br />WHERE trid = 18002<br />  AND language_code <> 'en'<br />  AND source_language_code IS NULL;

This solution might not be relevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 4 replies, has 0 voices.

Last updated by kamal-kishorS-2 7 months, 3 weeks ago.

Assisted by: Dražen.

Author Posts
September 25, 2025 at 4:53 am #17430507

kamal-kishorS-2

Background of the issue:
I am trying to resolve a database error that occurs when using the WPML plugin on my WordPress site. The error appears on the page: hidden link. The error message is related to a subquery returning more than one row in the database query. Here is the SQL query causing the issue: SELECT translations.translation_id, translations.element_type, translations.element_id, translations.trid, translations.language_code, translations.source_language_code, ( SELECT element_id FROM wp_icl_translations as originalTranslation WHERE originalTranslation.trid = translations.trid and originalTranslation.source_language_code IS NULL ) as original_doc_id, NULLIF(translations.source_language_code, '') IS NULL AS original, translation_status.rid, translation_status.status, translation_status.translator_id, translation_status.needs_update, translation_status.review_status, translation_status.translation_service, translation_status.batch_id, translation_status.timestamp, translation_status.tp_id, translation_status.ate_comm_retry_count, jobs.max_job_id as job_id, jobs.translated, jobs.editor, jobs.editor_job_id, jobs.automatic, jobs.ate_sync_count FROM wp_icl_translations as translations LEFT JOIN wp_icl_translation_status translation_status ON translation_status.translation_id = translations.translation_id LEFT JOIN ( SELECT MAX(job_id) as max_job_id, translated, editor, editor_job_id, automatic, ate_sync_count, rid FROM wp_icl_translate_job GROUP BY job_id ) as jobs ON jobs.rid = translation_status.rid WHERE translations.trid IN ( SELECT trid FROM wp_icl_translations WHERE (element_id = 20844 AND element_type = 'post_service') OR (element_id = 18002 AND element_type = 'post_service') OR (element_id = 17993 AND element_type = 'post_service') OR (element_id = 14907 AND element_type = 'post_service') OR (element_id = 16440 AND element_type = 'post_service') OR (element_id = 16407 AND element_type = 'post_service') OR (element_id = 16397 AND element_type = 'post_service') OR (element_id = 14707 AND element_type = 'post_service') OR (element_id = 14837 AND element_type = 'post_service') OR (element_id = 14791 AND element_type = 'post_service') OR (element_id = 14854 AND element_type = 'post_service') OR (element_id = 14819 AND element_type = 'post_service') ) AND 1 = 1.

Symptoms:
I am experiencing a WordPress database error: [Subquery returns more than 1 row].

Questions:
How can I resolve the database error related to the subquery returning more than one row?

September 25, 2025 at 5:41 am #17430551

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

please follow next steps:

1) Go to Plugins > Add New > Commercial > Click “Check for updates” and update WPML plugins to latest versions.

Please make sure to create a backup, before doing any actions, just in case.

2)
- Make sure you have a backup.
- Disable all other plugins and leave active only WPML plugins
- Switch to WP default theme
- Check if the issue still happens.

Let me know how it goes.

Regards,
Drazen

September 25, 2025 at 12:22 pm #17432358

kamal-kishorS-2

Hi,
I have create staging site and disabled all the plugin except the few which is required. I can't change the theme as service section is linked with theme. After disabling, the issue remain same. This error is showing in only one service out of 12 services.

Pls sugegst
Reagrds,
Kamal

Services.jpeg
plugin.jpeg
September 25, 2025 at 12:24 pm #17432387

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

please share the access details of your staging website, so I can log in and take a look. Please note, I will need to disable plugins /themes and debug issue there.

I’m enabling a private message for the following reply.

We have strict policies regarding privacy and access to your information.

Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/


- Please backup the site files and database before providing us access. 


Thanks,
Drazen

September 26, 2025 at 5:34 am #17434355

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks, there was a post in your DB that had translations of posts set as original languages also which caused issue. I am not sure how this happened, but there is an easy fix.

- Make sure to have a backup
- Run next code in your SQL database

UPDATE wp_icl_translations
SET source_language_code = 'en'
WHERE trid = 18002
  AND language_code <> 'en'
  AND source_language_code IS NULL;

Regards,
Drazen

September 26, 2025 at 4:26 pm #17436824

kamal-kishorS-2

Post update, Issue has been resolved.
Thanks,
Kamal