This thread is resolved. Here is a description of the problem and solution.
Problem:
You are facing an issue where Arabic, Chinese, and Russian property lists show more properties than the English list due to orphan translated properties that are not properly connected to the English originals.
Solution:
We recommend two methods to address this issue:
1. Manual Cleanup:
- Navigate to your Properties list in the Houzez post type.
- Switch to a secondary language (Arabic, Chinese, or Russian).
- Identify orphan properties indicated by a + icon, which means they are not connected to any original English post.
- Select these orphan properties in bulk and move them to trash.
This method is safest, especially if the number of orphans is manageable.
2. Database Cleanup: (Ensure you have a full database backup and preferably test on a staging site first)
- Use the following SQL query to identify orphan translated properties:
SELECT p.ID, p.post_title, p.post_status, t.language_code, t.trid FROM wp_posts p INNER JOIN wp_icl_translations t ON p.ID = t.element_id WHERE p.post_type = 'property' AND t.element_type = 'post_property' AND t.language_code IN ('ar', 'zh', 'ru') AND NOT EXISTS ( SELECT 1 FROM wp_icl_translations original INNER JOIN wp_posts op ON op.ID = original.element_id WHERE original.trid = t.trid AND original.language_code = 'en' AND original.element_type = 'post_property' AND op.post_type = 'property' AND op.post_status NOT IN ('trash', 'auto-draft') );- If the results are correct, proceed to delete the orphan properties with this SQL command:
DELETE p FROM wp_posts p INNER JOIN wp_icl_translations t ON p.ID = t.element_id WHERE p.post_type = 'property' AND t.element_type = 'post_property' AND t.language_code IN ('ar', 'zh', 'ru') AND NOT EXISTS ( SELECT 1 FROM wp_icl_translations original INNER JOIN wp_posts op ON op.ID = original.element_id WHERE original.trid = t.trid AND original.language_code = 'en' AND original.element_type = 'post_property' AND op.post_type = 'property' AND op.post_status NOT IN ('trash', 'auto-draft') );If these solutions do not resolve your issue or seem outdated, 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 problem 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.
This topic contains 5 replies, has 0 voices.
Last updated by 2 months ago.
Assisted by: Paola Mendiburu.