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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-07:00)

This topic contains 1 reply, has 0 voices.

Last updated by Bobby 1 month, 1 week ago.

Assisted by: Bobby.

Author Posts
April 29, 2025 at 11:44 pm #16981302

kendraR

Background of the issue:
I am trying to ensure that our language switcher for blog posts functions correctly. The main language on the site is English, and we have translations in Spanish. I manually added a link in the content for a blog post linking to its Spanish counterpart. The issue can be seen on this page: hidden link. I expected to see a button just above the content (Click here for Spanish) linking to hidden link, which is the Spanish version of the page.

Symptoms:
When the page is rendered in English, the link is changed to the English version, hidden link. It seems like WPML is automatically switching the url in the code back to English.

Questions:
Why is the manually added link to the Spanish version being changed to the English version?
Is there a way to prevent WPML from automatically altering the link?

May 2, 2025 at 7:04 am #16987995

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

this is a known and expected behavior as the plugin will point the URL to the current language since the content exists on it.

There are a few ways to get around this:

1. use the wpml_permalink filter to force a URL

Read More:https://wpml.org/wpml-hook/wpml_permalink/

2. use WPML’s language_switcher_url

Read More: https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/

Please let me know your results, and if you need further assistance from our team!

The topic ‘[Closed] Links to Alternate Language in the_content() Get Filtered to Primary Language’ is closed to new replies.