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 2 replies, has 1 voice.

Last updated by Dražen 21 hours, 23 minutes 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