Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 -
- - - - - - -

Supporter timezone: Pacific/Easter (GMT-05:00)

Tagged: 

This topic contains 0 replies, has 0 voices.

Last updated by Ilyes 1 month ago.

Assisted by: Ilyes.

Author Posts
December 6, 2024 at 11:32 pm #16487751

Ilyes
Supporter

Languages: French (Français )

Timezone: Pacific/Easter (GMT-05:00)

Small update, I'm sorry we wouldn't be able to clean the rest by today,

I should get a final cleaning by Monday, I will keep you updated,

Feel free to disable WPML and work on your site as always,

December 9, 2024 at 10:55 am #16492061

rabiaA

Hi Ilyes, it's very critical to try fix everything today because the customer already set a commercials due to the end of year like black Friday etc... and the website must function as expected.

Can you please try escalate it and make sure it's happening today only?

December 9, 2024 at 4:33 pm #16494235

rabiaA

Is there any update guys?

I'm totally blocked here, cause when disabling the WPML, the products duplicated, some with and some without images.

It's critical to resolve the issue tonight please!

December 9, 2024 at 5:50 pm #16494632

Ilyes
Supporter

Languages: French (Français )

Timezone: Pacific/Easter (GMT-05:00)

We are currently running tests and queries on a copy of your site, if everything got deleted correctly, we will share the solution shortly,

For WPML, you can reenable it and hide the languages from WPML > Languages if you don't want the visitors to see them,

December 9, 2024 at 7:23 pm #16494861

rabiaA

I prefer not as the CPU getting 100% very fast.
please try focus on the copy and confirm once ready to apply same fix into the website.

December 10, 2024 at 9:01 am #16496452

rabiaA

Any progress?

December 10, 2024 at 6:03 pm #16500051

Ilyes
Supporter

Languages: French (Français )

Timezone: Pacific/Easter (GMT-05: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.

You will, however, run into the limitation described in this erratum: https://wpml.org/errata/taxonomies-are-not-deleted-with-the-delete-content-from-database-option/

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.

Let me know if you have questions,

December 11, 2024 at 9:56 am #16502492

rabiaA

I don't understand what is needed to be done from my side.

What exactly you will do and what I need to do? can you please simplified things for me?

December 11, 2024 at 4:51 pm #16504732

Ilyes
Supporter

Languages: French (Français )

Timezone: Pacific/Easter (GMT-05: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.

Let me know how you want to proceed.

December 12, 2024 at 10:46 am #16507159

rabiaA

Website and DB backed up.

Please help me out here to clean all the Languages and keep the English so I can see the reduction of the DB tables size and rows count.

Thanks in advance,
Please try help today so we can see things working smoothly by today evening or tomorrow morning.

December 12, 2024 at 3:30 pm #16508714

rabiaA

Can you please confirm when you will do it?

December 13, 2024 at 11:53 am #16511199

rabiaA

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.

Can you please handle in priority?

December 13, 2024 at 1:35 pm #16511588

rabiaA

Guys,

I need a bit responsability from your side, the customer is threatening legal action because his business is completely shut down.

Please handle it in priority and keep me updated every one hour.

December 13, 2024 at 3:10 pm #16511877

Ilyes
Supporter

Languages: French (Français )

Timezone: Pacific/Easter (GMT-05: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,

Best,

December 13, 2024 at 4:08 pm #16512077

rabiaA

Thanks for the update,
Please do it carefully and wish you good luck and please provide me a good news once done.

The topic ‘[Closed] So disappointing performance due to WPML’ is closed to new replies.