In this example, 'documentation' represents the slug of the page you link to and don't want to take the user to the translation of this page. Please read more about this function in our documentation here.
1. You do not need to activate the Sticky Links add-on.
2. For existing pages and posts with links in their content, you might need to make a small change on the page and press the Update button. And then also update the translation.
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.
I've discussed this issue with our second tier supporter and there is a way to achieve what you need. You need to add the example following in the functions.php file of your site's theme.
1. You do not need to activate the Sticky Links add-on.
2. For existing pages and posts that have links in their content you might need to make a small change in the page and press the Update button. And then also update the translation.
Please let me know if you have further questions about this issue.
That did the trick. If I can make a suggestion, it would be to be able to do this without a filter. For example, a specific data attribute on the link like 'data-no-translation' or something.
At the following link, you can submit a feature request that goes directly to our developers. https://wpml.org/suggest-a-new-feature-for-wpml/
They will consider whether it is possible or needed to add this feature.
If you consider this issue as resolved please mark this ticket as resolved.
For future visitors: this ticket was started via a chat, and the chat record is hidden. So here is a summary.
TL;DR: There is no way to prevent WPML from translating a link to a page in the default language.
I have a site with several languages, and in this site I have a page that has been translated using the WPML translation system. At the top of this page I have a block of text that says "This page is avaialble in the following languages:" followed by a list of the site languages, and each lang name is linked to the translated copy of the current page.
So for example for FR I have
/fr/award-recipient/this-years-winner/
but for EN I have
/award-recipient/this-years-winner/
(note that the language is not part of the link)
When I view this page in any language that is not EN, the EN link is being translated into the language of the current page automatically. This is not what I want.
This seems to be because the system is converting a link to the default page language (EN) found in the translated text, into the translated link link for the page
To duplicate, you can do the following
1. In an EN site, make a new page and translate it into FR
2. add dummy content and confirm that both pages work correctly in the front end.
3. In the post content, add a link to the EN page without the domain, into each page content
Result: EN page links to EN, FR page links to FR (not EN as desired)
Said another way: how can I add a link in the post content, to a specific page in the site default language, without that link being translated? IOW I want to link to the EN page from a FR page, but when I try the EN link is being translated into FR and I do not want this to happen.
What seems to be happening is that the pasted page link to the default content is being converted by the WPML system into the default permalink format (in this case, /?p=911), which is then translated into the localized content.