Resolved
Reported for: WPML Multilingual CMS 4.3.15
Resolved in: 4.3.16
Overview of the issue
In some cases, it is possible that a link is converted to an ugly link.
e.g. /?p=1
This could happen if you have set the option for Default language in directory in WPML > Languages or if you use “Display as translated” mode for the post type that the post belongs to.
Workaround
As a workaround, you can use our hook filter: “wpml_sl_blacklist_requests”
add_filter( 'wpml_sl_blacklist_requests', 'wpml_sl_blacklist_requests', 10, 2 ); function wpml_sl_blacklist_requests( $blacklist, $sitepress ) { $blacklist[] = 'first-post'; $blacklist[] = 'second-post'; return $blacklist; }
Where ‘first-post‘ and ‘second-post‘ are permalinks for the affected posts.
And if gets assigned the wrong language too!
https://wpml.org/forums/topic/bug-in-multilingual-link-interpretation/#post-6142275
Thanks, Thierry, and sorry about this, the issue is already being worked on and once we have a fix and it’s tested we’ll release it. The current schedule for this is for WPML 4.4, but I will make sure it’s added to beta before that.
Workaround doesn’t work for me unfortunately.
Added the code with Code Snippets plugin.
Hi, can you please report that in our support forum so we can debug and see what’s going on and help you resolve? – https://wpml.org/forums/forum/english-support/
I feel that spreading cases in multiple forum posts does not help getting things done. We’re facing a problem that breaks sites. It should be dealt with fast
I agree – the fastest more efficient way is to move this from a comment to the support forum where we have the tools to help.
This remains unresolved here
We will soon have a bugfix release that has the fix for this.
Workaround doesn’t work for me, too.
Added the snippet to the functions.php of my child theme.
We will soon have a bugfix release that has the fix for this.
I have the same problem but it seems that it affect only the link in the content (I have WP Bakery Page Builder). And some links goes to the wrong pages/languages. For example the shop page links in the content go to a product page.
That code is not working. I have already a topic in the italian forum.
That issue is already fixed and tested, it’ll be added soon in a Beta version before it’ll be released in the next weeks – please try our beta version when it’s out and let us know if the issue was resolved.
The fix for this issue was just released together with our new WPML Beta version. You are welcome to give it a try (remember it’s a beta version not aimed to be used on production sites)