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
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 -

Supporter timezone: Europe/Zagreb (GMT+01:00)

Tagged: 

This topic contains 6 replies, has 1 voice.

Last updated by Dražen 4 days, 4 hours ago.

Assisted by: Dražen.

Author Posts
January 16, 2025 at 11:25 am #16601638

amigosS

Background of the issue:
I am using Elementor and Unlimited element to display carousels. I want the links to be linked to the current language. It works with all the links but the products attributes' ones (brands) because they are set to 'not translatable' and I don't want to translate them. I know the translated version of the links work though. Example: /brand/spitfire-wheels /fr/brand/spitfire-wheels/ work. Link to a page where the issue can be seen: hidden link

Symptoms:
On sliders with a link to a product attribute (brand), I expect to see the translated version of the link. Instead, I got the original language version of the link. WPML seems to be fixing them.

Questions:
How can I prevent WPML from changing my links in Elementor?
Why are product attribute links not showing the translated version?

January 16, 2025 at 2:05 pm #16602380

amigosS

Quick addition :
I have a shortcode that displays a list of brands (= products attributes).
It gets the content from a php page and edit all the links.

I stored in a var all the links separated by comas and displayed them in an html commented line before the rendered html and all of them are in the current language but the html code that is displayed has all its linked changed back to original language. WPML is 'fixing' the links using a wordpress hook somewhere. I need to prevent this action and be sure wpml doesn't change any link.

January 21, 2025 at 8:32 am #16616730

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks for contacting us.

You can try to use the wpml_sl_blacklist_requests flter and then re-translate page, and it should not adjust the slugs in 2nd language:

https://wpml.org/documentation/getting-started-guide/sticky-links/#:~:text=Sometimes%2C%20you%20might%20want%20to%20insert%20a%20link%20to%20a%20page%20that%20is%20in%20another%20language.%20Since%20Sticky%20Links%20adjusts%20the%20links%20automatically%2C%20it%20might%20prevent%20you%20from%20doing%20this%20and%20adjust%20the%20link%20to%20point%20to%20the%20same%20language%20instead.

But since you are using custom code I am not sure if this will work, you can also try switching to manual translation mode and manually adjust the 2nd language links to what you need: https://wpml.org/documentation/translating-your-contents/using-different-translation-editors-for-different-pages/

Or if nothing helps, hiring a WPML contractors to adjust your code and make it work correctly in 2nd language links also:

- https://wpml.org/contractors/

I hope this helps, let me know how it goes.

Regards,
Drazen

January 22, 2025 at 2:01 pm #16623493

amigosS

Hello, can you be more precise on this snippet please ?
And sorry for the misunderstanding but when I was talking about the custom code, it was just as an addition. The issue comes from translated elementor pages at first.

To explain in better :
- I have one homepage made with elementor.
- It has translated version.
- In this page, we have sliders with images and links.
- When translating links for different pages (normal pages, blogs, etc..) all is working great in all languages
- When translating brands link (which are product attributes set to "no translatable" since we don't translate brands BUT still have translated version of URL working (with the language is une the url), wpml shouldn't force the original version of the link.

Your solution seems to be the one we're looking for but we don't know what to put as $blacklist[] value. Can you help us on that ? (our brands url are : site.com/brand/the-brand-slug/

About the custom code : in these same pages, we call a shortcode that lists all the brands. To avoid long query when we charge the pages (as we want to make sure brands are not empty), we have a daily cron that writes all non-empty brands in a file, then the shortcode gets the content and displays it on our website. We tried to save all the links in a var and display it, it displays all the translated links for each pages but the displayed content of the shortcode itself is re-modified by wpml to the original version of the links. I think your solution could help us on that too.

Thank you

January 22, 2025 at 2:24 pm #16623675

Dražen
Supporter

Languages: English (English )

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

Hello,

I think I misunderstood the issue, I understood you want to keep it in the default language, but you actually wish to add a translated brend URL, correct?

If so, I have just tried you case and it seems to work fine in the test site, 2nd language not the translatable taxonomy URL stays the same, and WPML is not forcing the default language.

- hidden link

I suspect this could be an issue with your custom code or some additional plugin.

Would it be possible for you to confirm this issue still happens with the default theme and only WPML plugins and Elementor? We can also try it in the slider and on a regular page with text, to check what might be causing it.

Please try to reproduce the same issue in a simple example on this new test website:

- hidden link

Regards,
Drazen

January 22, 2025 at 6:10 pm #16624783

amigosS

Hello,

sorry. The issue is concerning woocommerce products' attributes. I can't try it without woocommerce plugin.

Here's how to reproduce it :
- install wpml, elementor and woocommerce
- create BRANDS attribute (do not use the newly added brands option in woocommerce, I'm talking about products attributes like sizes or whatever) with "brands" as a slug.
- in wpml setting, set this attribute as "not translatable".
- create an elementor page with the brand attribute link on a text/slider/widget (ie: hidden link) then translate this page with a translated link ( hidden link .

The attribute has to exist before ! (I tried writing a fake link : hidden link and I can see that it outputs "correctly" (since it doesn't exists it is filtered I think but like that : hidden link). I need wpml to just not filter urls by checking if they are good or not.

Let me know if you still see hidden link in the href of the translated version of the page.

January 23, 2025 at 7:41 am #16625796

Dražen
Supporter

Languages: English (English )

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

Hello,

okay, I tried to create the Cars attribute, since there is already taxonomy Brands from Wocommerce default.

But I can not get an attribute archive link to exist. This does not work even without WPML: hidden link

Can you please check and try to reproduce the issue:

- hidden link

Regards,
Drazen