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+02:00)

Tagged: 

This topic contains 13 replies, has 0 voices.

Last updated by John-Pierre Cornelissen 7 hours, 49 minutes ago.

Assisted by: Dražen.

Author Posts
June 24, 2025 at 11:14 am #17164431

John-Pierre Cornelissen

Background of the issue:
I use the shortcode [wpml_disabled_selector_widget] to display the language switcher on my site hidden link. The translator, who has the WP user role subscriber, translates with the classic translation editor.

Symptoms:
When I receive the translated content, the shortcode in the translations is [wpml_disabled_selector_widget], which shows "You're not allowed to use this shortcode." in the front end.

Questions:
Why does the translation get a different shortcode?

June 24, 2025 at 11:27 am #17164487

Dražen
Supporter

Languages: English (English )

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

Hello,

this is the ticket, let us know how it goes and if anything else we can do.

Regards,
Drazen

June 25, 2025 at 8:38 am #17167686

John-Pierre Cornelissen

Hi,

I have tested this and now I am 100% sure that it's WPML who changes the shortcode upon saving the translations from

[ wpml _language _selector _widget ]
to
[wpml_disabled_selector_widget]

Here is a screen recording that shows what/how it happens.
hidden link

Thanks
JP

Edit: I added spaces in the correct shortcode, because here too it changes the correct shortcode into the wrong one.

June 25, 2025 at 9:26 am #17167937

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks for getting back and sharing video, that is very helpfully.

Now we need to confirm if it is an bug or issue specify to your website.

1) If possible, can you test if issue happens when using Divi parent theme and only WPML plugins enabled, all other disabled?

2) For same reason a created test site with Divi, and tried to translate, but I do not get same issue, maybe there is specific Divi widget that needs to be used?

Can you please check and try to reproduce it there? That way I can quickly escalate it further.

- hidden link

Let me know how it goes.

Thanks,
Drazen

June 25, 2025 at 12:02 pm #17169069

John-Pierre Cornelissen

Hi, the same thing happens in the Sandbox.

1. Have a look as the demo user: there is one page, translations are correct
2. Send that page to the 'translator' user
3. Login as the 'translator' user, pw: rdD$wewRvakKUVhQ%sRkVBbw
4. Take the translations, make sure the shortcode in the source and target is the same and complete the translations
5. Have a look at the translated page, it shows "You're not allowed to use this shortcode."
6. Go back to the translations and you'll see the shortcode is incorrectly saved.

June 25, 2025 at 12:54 pm #17169353

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks a lot for clear info and confirming the issue.

I have confirmed it and escalated to our 2nd tier to check further, escalate and advise any workaround.

I will update when I have some news.

Regards,
Drazen

June 25, 2025 at 2:30 pm #17169922

Dražen
Supporter

Languages: English (English )

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

Hello,

Seems we have this intentionally set.

If a user does not have the ability to use a short code or the capability "unfiltered_html" then it will replace the short code with that.

Workaround - add define constant to wp-config.php

define('WPML_TRANSLATOR_CAN_USE_LS_SHORTCODE' true);

Regards,
Drazen

June 25, 2025 at 2:51 pm #17170048

Dražen
Supporter

Languages: English (English )

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

Hello,

sorry correct constant would be:

define('WPML_TRANSLATOR_CAN_USE_LS_SHORTCODE', 'true');

Regards,
Drazen

June 26, 2025 at 8:26 am #17171933

John-Pierre Cornelissen

Hi Dražen,

For what reason is this intentional?

It doesn't make sense to me. There is a perfectly working shortcode in the source, so that same shortcode goes in the translation for a good reason. There is absolutely no reason for WPML damaging/changing it's own shortcode (or any other shortcode for that matter).

Third party translators should only translate and do nothing else. Therefore they get the lowest WP role possible, which is a 'subscriber'. The next lowest role is a 'contributor' but they can also write posts. A translator shouldn't be doing that.

Of course I can add that constant as a workaround, but why should I even be doing that if all I want is that a translator does the only thing WPML is meant to be doing? Nothing else.

Also, does the same apply to the ATE?

Thanks
JP

June 26, 2025 at 9:04 am #17172392

John-Pierre Cornelissen

Update to the previous, I have checked this further, and 'intentional' setting means that a translator needs to be a WP editor or admin to be able to use the same shortcode in the translations as is added to the source. This basically gives the translators the right to also edit all content and create/publish anything they like.

That's not very well thought out. A translator should only translate and shortcodes in their translations should remain the same as in the source. WPML shouldn't damage them. And a translation manager or site admin shouldn't be required to a constant to disable this silly behaviour and make sure WPML does what it is supposed to do.

June 26, 2025 at 9:27 am #17172505

John-Pierre Cornelissen

Sorry another one. I added the constant (see screen shot) and it does not fix the issue.

wpml constant.jpg
June 26, 2025 at 11:04 am #17172988

Dražen
Supporter

Languages: English (English )

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

Hello JP,

it is due the user role and unfiltered_html permission. This is more related Worpdress roles and capabilities then only WPML, but of course we respect it for security reasons.

The unfiltered_html permission is a security feature in WordPress that prevents users from using iframes and code snippets in WordPress posts, plus also more advanced code such as Javascript. This unfiltered_html permission could be very dangerous in the wrong hands, so WordPress has disabled this permission for most users.

By default, the unfiltered_html permission is only given to Super Admins, Administrators and Editors.

It does not happen for ATE editor and works fine if you use ATE translation editor.

As for constant not working, please make sure to re-send and re-translate. I have tested it before sharing it with you, and it works just fine on our side. I can share a video if needed.

Regards,
Drazen

June 26, 2025 at 11:24 am #17173060

John-Pierre Cornelissen

Hi,

It doesn't work for me. See this video: hidden link

I know what the permission is for, but it absolutely makes no sense that WPML replaces it's own shortcode with something else. As if it doesn't trust itself. It cripples it's own functionality.

You also see @0:33 in the video referenced above that the third party shortcode [ masterslider id="17" ] is kept as is in the translation.

A translator, regardless what user role, should be able to use the same shortcodes that are also located in the source.

So, it's only WPML's own shortcode that is being replaced. If that's not a bug, I don't know what else to call it.

JP

June 26, 2025 at 2:10 pm #17174068

Dražen
Supporter

Languages: English (English )

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

Hello JP,

thanks for getting back, I understand your point of way, but I am afraid as I have explained above and there is working workaround / constant , our 2nd tier does not consider this a bug and the esclated ticket is closed from our side.

If you disagree I can bring this up again and ask for second opinion.

As for issue, please try to make a small change to default language page, save and then re-translate. If issue still happens please wp-admin access and FTP to your website, preferably staging site and I will check it out.

Regards,
Drazen