Our English property import is correct and currently shows 96 properties.
However, Arabic, Chinese, and Russian property lists show more than 140 properties. Some old translated properties remain even though the original English properties no longer exist.
We are using:
WP All Import / WP All Import Pro
WPML Import and Export
Houzez theme property custom post type
English as the original import language
Arabic, Chinese, and Russian as translated languages
In WPML settings, we already enabled:
When deleting a post, delete translations as well
When deleting a taxonomy, delete translations as well
The issue seems to be orphan translated properties that are not connected properly to the English originals, so WPML is not deleting them.
Could you please guide us on the safest way to:
Identify translated properties that do not have a matching English original.
Delete only those orphan translated properties.
Re-sync translation relationships for existing valid properties.
Avoid deleting shared media/images incorrectly.
We need the property counts in Arabic, Chinese, and Russian to match the English count of 96.
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Madrid (GMT+02:00)
Hi there!
This is Paola and I hope you are well!
In this case, there are two safe ways to proceed: a manual cleanup and a database cleanup.
1. Manual method (safe and recommended first):
You can identify orphan translations directly from the Properties list:
Go to your Properties (Houzez post type).
Switch to a secondary language (Arabic, Chinese, or Russian).
Check the language icons:
+ plus icon → this means the property is not connected to any original English post (orphan)
pencil icon → this is a valid translation
The properties showing the + icon are the orphan ones.
You can:
- Select them in bulk
- Move them to trash
This is the safest way, especially if the number is manageable.
2. Database method (please make sure to create a full database backup and ideally test this on a staging site first)
- Review 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')
);
This will show all translated properties that do not have a valid English original.
- Delete orphan translated properties
If the results above look correct, you can proceed with:
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')
);