Background of the issue:
I have some buttons set as translatable. After translating the buttons in the translation editor, ?lang=nl is being added to external links.
Symptoms:
Some external links aren't working because ?lang=nl is added.
Questions:
How can I prevent that ?lang=nl is added?
Here is the ticket. I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.
Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.
Your upcoming reply will be treated with confidentiality and will only be visible to you and me.
✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.
Kor is OFF for a few days, so I checked the ticket and the issue.
I can see you are using the ACF link field and have set it to Translate settings, so in this case, you actually need to translate it fromthe Advanced translation editor, or if you wish to use the same value, set this field to Copy and re-translate the page.
I already tried to insert an other url as translation. When i replace the url to hidden link for example, it's still adding ?lang=nl to that url so the translated url is pointing to hidden link.
This ensures that the buttons in the hero section automatically link to the translated content. However, when I remove this line, the "?lang=nl" parameter is not added, so it works for external URLs. But in cases where I link to another page within the site, the button does not redirect to the translated page but instead defaults back to the original language. For example: hidden link
Is there a way to make the button automatically link to the translated content? Or should i place the filter in an IF statement where i check if the domain is equal as the current domain.
If you're using a static link then you'll have to translate the link manually. If you use dynamic links, WPML should be able to connect the link to the correct translated page. Do you use any page builders like Elementor?
We're using the Link field from ACF. This field is set to translatable.
It works if we manually change the URL in the translation editor. However, I would like it to automatically point to the translated version of the original page when it is not manually set in the translation editor.
Sorry, this is not possible though. The links must be translated manually.
The topic ‘[Closed] Lang parameter added on external websites’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.