Skip Navigation

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

Problem:
You are testing the translation of products using WP Sheet Editor and encountering issues with updating the product's URL slug after translation. The setting to translate based on the product's title is configured, but the button to scan and update links is unresponsive. Additionally, translated products appear in WooCommerce's product list but not in WPML Multilingual & Multicurrency.

Solution:
We recommend using a universal formula for slug creation that can be applied directly in WP Sheet Editor. Here's a step-by-step guide:

1. Open WP Sheet Editor and load your products.
2. Apply the following formula in the Slug column, which is based on the Title column:

=LOWER(SUBSTITUTE(SUBSTITUTE(REGEXREPLACE(A2,"[^a-zA-Z0-9 ]",""), " ", "-"), "--", "-"))

3. Copy this formula down for all rows to update the slugs.
4. Save the changes and then proceed with the import.

This formula will help create URL-safe slugs by converting titles to lowercase, removing special characters, and replacing spaces with hyphens, ensuring compatibility across different languages.

If this solution does not resolve your issue or seems 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. Should you need further assistance, 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 14 replies, has 2 voices.

Last updated by Rafael 7 months, 3 weeks ago.

Assisted by: Bruno Kos.

Author Posts
October 10, 2024 at 3:50 am #16272787

Rafael

Background of the issue:
I am testing the translation on a few products before applying it to the rest. I am using WP Sheet Editor. After translating a product according to a tutorial, I want to update the product's URL slug using WPML. The setting is configured to translate based on the product's title, which is desired.

Symptoms:
The product's URL slug cannot be updated after translation. The button in the settings to scan and update links does nothing. Translated products appear in WooCommerce's product list but not in WPML Multilingual & Multicurrency.

Questions:
If you will confirm that I should not use WP Sheet Editor to translate products to my purpose, there are questions about using Woo's Import/Export build in feature instead:

1) If I use WooCommerce's export/import function, does the spreadsheet need to include the original content/products - the ones that I'm translating from?
2) Is it necessary to translate the product's category/hierarchy if it was already translated separately?
3) Will the translation be unsuccessful if I don't provide 'import_translation_group' for translated items where the original product has it?

October 11, 2024 at 4:01 am #16277461

Rafael

Ok, ignore all other questions - I'm interested only in translating the slug after making translation of the product with WP Sheet Editor

October 14, 2024 at 6:19 am #16284041

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for contacting WPML support!

There is an option in WPML to make slugs translatable - is this what you are looking for?

Regards,
Bruno Kos

translate slug.jpg
October 14, 2024 at 6:33 am #16284077

Rafael

Yes, it is turned on and yet not automatically translated alongside the title

Screenshot 2024-10-14 083304.jpg
October 14, 2024 at 10:28 am #16285213

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

That first option would only auto generate it based on the title.

If you want to translate it, you need to activate the second option.

But even if you do, after you activate it you need to open the original and resave is so that the setting takes effect.

October 14, 2024 at 1:01 pm #16286147

Rafael

But I want it to translate it from the title and according to the description it won't do it automatically. So I have to tamale it manually?

October 14, 2024 at 9:03 pm #16287913

Rafael

And still the question about products remains:
Why WC's products in english have list of 3 products, while WPML Multilingual & Multicurrency panel have only 1 product.

October 15, 2024 at 5:41 am #16288587

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Correct, it will not do it manually.

As for your 2nd question, can you show me screenshot that shows this discrepancy?

October 15, 2024 at 11:20 am #16290172

Rafael

It is in first post

October 15, 2024 at 1:03 pm #16290897

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Ah yes, I apologize.

Can you try the following:
- WPML - > Support -> Troubleshooting:
– Synchronize posts taxonomies (for products and then for variations)
-- Clear the cache in WPML
-- Remove ghost entries from the translation tables
– Assign translation status to duplicated content
-- Set language information
-- Fix terms count
-- Fix post type assignment for translations

Do these appear now? I assume these products were all added through the same method (Woo's Import/Export?)?

October 16, 2024 at 12:37 am #16292872

Rafael

None of this make any difference - still I don't have slug translated nor have items in WPML M&M menu

October 16, 2024 at 12:41 am #16292873

Rafael

As mentioned in first post - it was made via WP Sheet Editor. This plugin makes duplicate to another language version.

October 16, 2024 at 9:10 am #16294269

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

I see, can you send me a screenshot on what you are using to duplicate them into other languages, which option within the WP Sheet Editor?

Would you be willing to provide me with WordPress and FTP credentials so I could investigate the issue directly?

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

I marked your next reply as private so that you can safely add credentials.

We have covered several scenarios https://wpml.org/documentation/plugins-compatibility/transfer-wpml-translations-from-one-site-to-another-with-wp-sheet-editor/#how-wp-sheet-editor-works, however it is possible that duplication of products (or any other content) is not implemented so I would consult our compatibility about this. I found no other cases in our forums related to this specific functionality.

Unless you want to duplicate them like this in bulk using WPML built in feature https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/#how-to-duplicate-pages-and-posts-in-bulk

Let me know!

October 17, 2024 at 7:13 am #16298376

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Ok, so it seems that after exporting and importing the products via CSV, all products are show in M&M?

But as for slugs, I am not completely familiar with inner workings of WP Sheet Editor, but would this not work for you?

Something like this:

### Universal Formula for Slug Creation:

=LOWER(SUBSTITUTE(SUBSTITUTE(REGEXREPLACE(A2,"[^a-zA-Z0-9 ]",""), " ", "-"), "--", "-"))

### Explanation:
1. `LOWER(A2)`: Converts the title to lowercase.
2. `REGEXREPLACE(A2, "[^a-zA-Z0-9 ]", "")`: Removes all special characters except for alphanumeric characters (letters and numbers) and spaces.
3. `SUBSTITUTE(" ", "-")`: Replaces spaces with hyphens to form the slug.
4. `SUBSTITUTE("--", "-")`: Ensures that multiple hyphens (from extra spaces) are reduced to a single hyphen.

This will create URL-safe slugs regardless of the language, by eliminating any accented or special characters universally.

You can apply this formula in WP Sheet Editor in the **Slug** column and copy it down for all products.

- Open WP Sheet Editor, load products.
- Use the formula in the **Slug** column based on the **Title** column.
- Copy the formula down for all rows.
- Save the changes.

And then do the import?

October 17, 2024 at 10:10 pm #16302251

Rafael

Tell me - how important it is to have products in WPML M&M menu?
If they are appeared in WC's product menu in specific language tab (as translated) is it ok then? Could there be any problems whatsoever?

If I duplicate the product - it is not shown in M&M menu. But I can still translate it manually (or via WP Sheet Editor) - is it ok if I do so? Could there be any problems/errors?