Skip Navigation

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

Problem:
You are trying to remove WooCommerce's strings from the database using the 'Remove strings by domain' feature, but it has no effect. Even though you receive a success message, the strings remain in the database.
Solution:
1. The 'Remove strings by domain' feature only deletes untranslated strings. If the string is translated, it won't be affected.
2. To delete strings manually, go to String Translation, select the WooCommerce text-domain, and delete the strings. You can show all results using the "Strings per page:" filter below the strings table.
3. If you need to remove strings directly from the database, use the following SQL queries:

DELETE FROM wpif_123_icl_strings WHERE context = 'woocommerce';

DELETE FROM wpif_123_icl_string_translations WHERE string_id IN (SELECT id FROM wpif_123_icl_strings WHERE context = 'woocommerce');

Please note that this custom code is a courtesy and is not officially supported by us. Before applying it to a live site, please test it in a staging environment.

If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. We also 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. For further assistance, please visit our support forum at https://wpml.org/forums/forum/english-support/.

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 6 replies, has 0 voices.

Last updated by vincentP-19 7 hours, 26 minutes ago.

Assisted by: Osama Mersal.

Author Posts
February 8, 2025 at 9:47 pm #16683230

vincentP-19

Background of the issue:
I am trying to remove Woocommerce's strings from the database using the 'Remove strings by domain' feature, but it has no effect. We get a success message, but the strings are still there. We thought about using the query: DELETE FROM wpif_123_icl_strings WHERE `context`='woocommerce'; but that wouldn't clean up data from the other tables like _icl_string_translations.

Symptoms:
The 'Remove strings by domain' feature has no effect. Despite receiving a success message, the strings remain in the database.

Questions:
Could you please tell us the queries' equivalent?
Is there a function we can loop and call to perform this operation on 300+ sites?

February 9, 2025 at 9:16 am #16683620

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

1) This option deletes the untranslated strings. If the string is translated, it won't affect it.

2) Could you please share your Debug information with me?
You can read a detailed explanation about it here. (http://wpml.org/faq/provide-debug-information-faster-support)
The debug info will give me much information about how your site is configured.

Best regards,
Osama

February 9, 2025 at 8:16 pm #16684654

vincentP-19

That makes sense then!

We'd still like to have help about removing these strings since none of the subsites use Woocommerce (it was entirely removed from our network).

The debug info should be attached now!

February 10, 2025 at 10:06 am #16686168

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Please go to String Translation, select the WooCommerce text-domain, and delete the strings.

You can show all results using the "Strings per page:" filter below the strings table.

Best regards,
Osama

February 10, 2025 at 1:37 pm #16687367

vincentP-19

Thank you,
Could you provide us with a query example? (the equivalent of 1x string deletion)
Or a helper function if there is any?

While your solution works, we need to do that on 300+ sites and cannot do it by hand. (we need a way to do it programmatically)

Thank you for your patience!

February 10, 2025 at 1:47 pm #16687402

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Please try the following queries:

DELETE FROM wpif_123_icl_strings 
WHERE context = 'woocommerce';
DELETE FROM wpif_123_icl_string_translations 
WHERE string_id IN (
    SELECT id FROM wpif_123_icl_strings WHERE context = 'woocommerce'
);

Please note that this custom code is a courtesy and is not officially supported by the WPML team. Before applying it to a live site, please test it in a staging environment.

Best regards,
Osama

February 10, 2025 at 1:53 pm #16687418

vincentP-19

Thank you! We presume we should execute the 2nd query first, we'll give those a try. 🙂