Languages: English (English )French (Français )Arabic (العربية )
Timezone: Pacific/Easter (GMT-06:00)
Hello,
On the local copy, we were able to delete most of the content with the following steps:
- We disabled all plugins except for WPML itself (you may not need to do this, but it puts less stress on the resources)
- We added the plugin WPCode Lite and I added a custom PHP snippet, which I set to On Demand (i.e. when I click a button)
- WE added this code to the snippet:
// Run for 'ar' until there are no more posts, then repeat for 'he'
$language_code = 'ar';
global $wpdb;
$query = "
SELECT *
FROM wp_icl_translations
WHERE language_code LIKE %s
AND element_type LIKE 'post_%'
LIMIT 200
";
$results = $wpdb->get_results(
$wpdb->prepare($query, $language_code)
);
if (!empty($results)) {
foreach ($results as $result) {
$deleted = wp_delete_post( $result->element_id, true );
}
}
We are going to use the above to remove the translated content in batches. I set the limit to 200 posts at a time. There are roughly 1600 posts of varying types for Arabic and for Hebrew, so it will be necessary to manually trigger the code about 8 times for 'ar', then edit the snippet to change the language code to 'he', and trigger the code another 8 times.
It looks like this in the editor: hidden link
Each time the snippet runs it will take a good few seconds to complete, it should be obvious.
When the above has been done you can return to WPML > Languages and try once more to delete any remaining content if there are a few posts left over.
The routines to delete translated content when removing languages overlooks taxonomies. The erratum describes how that can be done manually.
Once that is completed it should be possible to then go to the WPML troubleshooting page and perform a Reset, which will also delete WPML's database tables.
Languages: English (English )French (Français )Arabic (العربية )
Timezone: Pacific/Easter (GMT-06:00)
All the steps I shared in my previous reply is actually already tested on a local version of the site, you just need to run the same steps as described on the live site,
With your permission and after saving a backup, I can run them for you.
Why I don’t see any updates? It’s affecting the whole business and truly not sure to update the customer, we have backup but not sure if you’re guys progressing or not.
Languages: English (English )French (Français )Arabic (العربية )
Timezone: Pacific/Easter (GMT-06:00)
I apologize for the delay, I'm currently working on this and it should be done in the upcoming hours,
We had a high surge in requests and we are short of supporter because of the holidays season, I understand the urgency of this case, I will start working on this now, please limit the backend usage for the next hour,
Languages: English (English )French (Français )Arabic (العربية )
Timezone: Pacific/Easter (GMT-06:00)
Update, I increased your PHP limits to 2Go for the snippet to work without failing, and I have avoided disabling any plugins so it won't affect the access to the site, which required lot of resources.
I can only delete 100 posts at a time with it, and I'm almost done with Arabic posts,