Skip to content Skip to sidebar

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

Last updated by Dražen 2 days, 7 hours ago.

Assisted by: Dražen.

Author Posts
April 3, 2026 at 8:35 am #17947515

Kris Sinnaeve

Recently we discovered that when adding embedded URLs in the post body referring to the same post but in another language (we have a bilingual site Dutch-English, but not all content is translated as not always applicable), the URL's are overwritten when saving (not when previewing the changes).

The misbehavior looks similar to https://wpml.org/forums/topic/wpml-french-redirect-bug-full-debugging-summary/ but playing with the WPML Sticky Link renders the URL human-unreadable (?p=...). The ?p=... URL points the correct page, but when accessing it from the front-end, it is rewritten somewhere else again to the wrong one.

My question is: how do I prevent inline URL's to be rewritten? If I decide to add an URL manually, I don't want it to be overruled.

April 7, 2026 at 5:57 am #17952612

Dražen
Supporter

Languages: English (English )

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

Hi,

Thanks for the detailed explanation.

As I understand it, you are manually inserting links to a page in another language. In this case, WPML will automatically adjust those URLs, which is why your manual links are being overwritten.

To prevent this behavior, you can exclude specific links from being rewritten. This can be done by blacklisting certain slugs so WPML does not modify them.

You can find more details here:
https://wpml.org/documentation/getting-started-guide/sticky-links/#linking-to-pages-in-a-different-language

This is as it is not expected to add different language URLs, so if you need it in some case you will need to use the workaround above.

Let me know if any questions or doubts.

Best regards,
Dražen

April 14, 2026 at 7:40 am #17967630

Kris Sinnaeve

Thanks for getting back to me.
Due to holidays, I wasn't able to respond earlier.

Your suggestion to exclude specific links by blacklisting certain slugs doesn't really make sense to me as I would have to exclude all: when we add an URL pointing to the same event in the other language, we do that deliberately as our events are in most cases one-language only.

So if I could exclude events only (by adding 'event' to the blacklist), I think that could do (for now).
Can you confirm that would do it? I've added the WPML Sticky Links to a staging environment and things went quite terribly wrong (URL's replaced with ?p=...).

Thanks in advance,
Kris

April 14, 2026 at 8:38 am #17967817

Dražen
Supporter

Languages: English (English )

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

Hello Kris,

Thanks for getting back to me, and no worries at all.

Regarding your idea excluding all events by adding something like “event” to the blacklist in theory that could help limit the behavior.

Also, just to clarify: I would not recommend using the Sticky Links add-on in your case. What you experienced (URLs being replaced with ?p=… format) is expected behavior for that plugin, and it’s generally not suitable for setups like yours.

From WPML’s perspective, it’s designed to use the correct language-specific URLs and their translations. Manually linking to content in a different language (as you’re doing for one-language events) is a more custom use case and not something WPML handles out of the box.

If this affects many URLs, the best approach would be to handle it via a small custom code adjustment tailored to your logic (e.g. conditionally preventing URL rewriting for specific post types like events).

Example from another user: https://wpml.org/forums/topic/i-dont-want-my-links-to-be-translated-by-default/#post-17451584

Kind regards,
Dražen

April 20, 2026 at 12:27 pm #17980924

Kris Sinnaeve

Based on the example of danielI-23 you're referring to, I was able to fix this.
I've added the following in the theme's functions.php file:

if (!function_exists('wpml_sl_blacklist_requests')):
/**
* Prevent slug to be translated behind the scenes by WPML
*/
function wpml_sl_blacklist_requests( $blacklist, $sitepress )
{
$blacklist[] = '/event\/.*/';
$blacklist[] = '/downloads\/.*/';

return $blacklist;
}
endif;

add_filter( 'wpml_sl_blacklist_requests', 'wpml_sl_blacklist_requests', 10, 2 );

Happy to hear if it's possible to exclude all slugs as I expect I'll have to add more slugs in the (near?) future.

To be complete: I didn't use the WPML Sticky Links here.

April 21, 2026 at 5:49 am #17982539

Dražen
Supporter

Languages: English (English )

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

Hello,

Thanks for sharing this, and glad to hear you managed to fix it.

Best approach is to keep adding only the specific patterns you need, as you did.

Regards,
Dražen