Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
On multilingual tour pages, internal links that should point to other language versions of the same page are being automatically rewritten by WPML to point to the current page's language version.
Solution:
If you're experiencing this issue, we recommend using the following hook to prevent WPML from automatically adjusting internal links on your site:

add_filter( 'wpml_translate_link_targets', '__return_false' );

Additionally, consider using the WordPress Editor as a translation method for specific pages. This approach can help prevent the Advanced Translation Editor from automatically adjusting translated internal links. For more details on using different translation editors, please visit: Using Different Translation Editors for Different Pages.

Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.

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.

Tagged: 

This topic contains 5 replies, has 0 voices.

Last updated by Andreas W. 3 weeks, 2 days ago.

Assisted by: Andreas W..

Author Posts
May 14, 2026 at 6:57 pm #18036855

davidM-175

On multilingual tour pages, internal links pointing to other language versions of the same page are being automatically rewritten by WPML to point to the current page's language version instead.

May 15, 2026 at 2:27 pm #18039324

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for reaching out!

WPML's internal links will always automatically point to the current active language.

Do I understand correctly that you try to display content in different languages on the same page?

Could you please send me a URL where I can see the issue?

Best regards
Andreas

May 15, 2026 at 6:52 pm #18039806

davidM-175

Hello Andreas,

many thanks for coming back on this one.

Here you can see the issue: hidden link

For SEO is good if the pages are connected by internal links so we are offering on this page the same tour in different languages - do you speak English?click here!
But all the links are always changed back to the same page.

It's interesting that at older pages it's working very well. For example here:

hidden link

Do you have some idea how to solve it?

Many thanks,
David

May 15, 2026 at 10:45 pm #18039915

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

There is a hook available that allows you to disable the automatic internal link adjustment:

add_filter( 'wpml_translate_link_targets', '__return_false' );

I would suggest to let it run only on the Frontend:

add_filter('wpml_translate_link_targets', function ($translate) {

	// Frontend only
	if (is_admin() || wp_doing_ajax() || wp_doing_cron() || (defined('REST_REQUEST') && REST_REQUEST)) {
		return $translate;
	}

	if (! is_page()) {
		return $translate;
	}

	return $translate;
});

You could add it to the functions.php file of a Child Theme or a Code Snipept Plugin.

You could also try to wrap it into a conditional to make it run only on specific pages, but note that all translated pages have unique post IDs.

May 18, 2026 at 7:51 am #18041811

davidM-175

Hello Andreas,

I added the code to the functions.php file, but unfortunately it still didn't work as expected. After some consideration, I've decided to remove the links altogether — it seems we've exhausted our options on this one.

Thank you so much for your help and time — it is very much appreciated!

Best regards,
David

May 19, 2026 at 11:30 am #18045576

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello David,

If you use only this hook, WPML usually should stop to automtically adjust intern links on the entire site:

add_filter( 'wpml_translate_link_targets', '__return_false' );

In case any further assistance is needed, I will be glad to take another look as admin into this.

Also, what you could try for this specific page is using the WordPress Editor as a translation method, as this will prevent the Advanced Translation Editor from automatically adjusting translated internal links.

Guide: https://wpml.org/documentation/translating-your-contents/using-different-translation-editors-for-different-pages/

Anyhow, this would need testing, as usually it would be expected that WPML always points to the current active language.

Best regards
Andreas