This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is experiencing issues with translating internal English URLs to Spanish on their multilingual site. The 'Adjust Links Feature' does not update the links, and manually adjusting them across numerous pages is not feasible. The issue was identified in the
WPML_Name_Query_Filter_Translated
class, where the logic incorrectly returns the first URL match for all subsequent links.
Solution:
If you're experiencing similar issues with internal link translations in WPML, we recommend applying a temporary workaround. Navigate to
wp-content/plugins/sitepress-multilingual-cms/inc/query-filtering/wpml-name-query-filter-translated.class.php
and add the following line at line 49:
$this->pages_to_langs = array(); //workaround!!!
This code resets the array that was incorrectly storing URLs, allowing each link to be translated correctly. For detailed guidance on translating links, please visit https://wpml.org/faq/how-to-translate-links/.
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 for further assistance.
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.