Skip Navigation

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

Problem:
You are trying to list all of your pages and posts that have not been translated from English using SQL.
Solution:
We recommend referring to our documentation on WPML tables and language information: WPML Tables Documentation.
To find posts that have not been translated, you can use the following SQL code:

SELECT *<br />FROM wp_icl_translations<br />WHERE trid IN (SELECT trid<br />FROM wp_icl_translations GROUP BY trid having count(trid) = 1)

If you need to filter by a specific post type, such as 'Pages', modify the SQL like this:

SELECT *<br />FROM wp_icl_translations<br />WHERE trid IN (SELECT trid<br />FROM wp_icl_translations GROUP BY trid having count(trid) = 1) and element_type LIKE 'post_page'

Remember to prefix the post type with 'post_'.

If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at WPML Known Issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, 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 2 replies, has 2 voices.

Last updated by Mihai Apetrei 3 years, 2 months ago.

Assisted by: Mihai Apetrei.

Author Posts
January 25, 2022 at 12:42 am #10422649

michaelB-212

Tell us what you are trying to do?
Is there some simple SQL to list out all of my pages and posts that have not been translated from English?

January 26, 2022 at 11:23 pm #10440725

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

We have some documentation that can help here:
https://wpml.org/documentation/support/wpml-tables/#language-information-and-translations

I will need to double check on this with a developer from our team so I will get back to you as soon as I have a response.

I'm leaving the ticket assigned to myself for the moment.

Thank you.

Mihai Apetrei

January 31, 2022 at 2:22 pm #10471291

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

I am back with a response from our developers after the recommended SQL code has also been tested.

The SQL that you can use to filter posts and find only the ones that have NOT been translated is this:

SELECT *
FROM wp_icl_translations
WHERE trid IN (SELECT trid
FROM wp_icl_translations GROUP BY trid having count(trid) = 1)

If you want to filter by a specific post type, like for "Pages" for example, you can use it like this:


SELECT *
FROM wp_icl_translations
WHERE trid IN (SELECT trid
FROM wp_icl_translations GROUP BY trid having count(trid) = 1) and element_type LIKE 'post_page'

You can filter any post type but remember that it has to be prefixed by "post_".

Kind regards,
Mihai