Skip to content Skip to sidebar

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

Problem:
You are using WPML with a custom permalink structure managed by https://permalinkmanager.pro/ and are facing issues with WPML not correctly translating URLs or linking to incorrect URLs. You need a way to override the translated URLs within the WPML class 'AbsoluteLinks' and are looking for a filter within '_process_generic_text' or another part of 'AbsoluteLinks' to achieve this.
Solution:
Currently, there is no filter available within '_process_generic_text' that allows for overriding translated links. To address your issue, you will need to either reproduce the URL replacement functionality outside of this class or consider patching the plugin. Unfortunately, there is no straightforward hook available to reimplement the URL replacement feature if you disable the default functionality with 'wpml_sl_blacklist_requests'.

If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. We also 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. For further assistance, please visit our support forum 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 1 reply, has 0 voices.

Last updated by Otto 3 months, 1 week ago.

Assisted by: Otto.

Author Posts
November 27, 2025 at 5:49 pm #17616153

danM-2

Background of the issue:
I am trying to use WPML to automatically convert URLs to the translation of a post when it is duplicated. For example, if an English post links to /about-us, the Spanish version should link to /sobre-nosotros. We are also using hidden link to configure custom permalinks for taxonomies and pages. However, WPML is not aware of these custom permalink structures. We have identified that the URL conversion feature happens in the WPML class `AbsoluteLinks`. We can disable the functionality with `wpml_sl_blacklist_requests`, but we can't find an appropriate hook to re-implement the functionality using our custom permalink structures. For pages, we can use the `url_to_postid` filter to return the correct post ID, but we can't return a term from `url_to_postid`.

Symptoms:
WPML is either not translating URLs or resolving to a completely wrong URL due to incompatibility with custom permalink structures. We need a filter within `_process_generic_text` or another part of `AbsoluteLinks` to override the translated URL.

Questions:
Is there a filter within `_process_generic_text` or another part of `AbsoluteLinks` to override the translated URL?
Where can we find an appropriate hook to reimplement the URL replacement feature if we disable the default functionality with `wpml_sl_blacklist_requests`?

November 27, 2025 at 6:48 pm #17616430

Otto

Hello,

No, there is currently no filter that lets you override a translated link inside _process_generic_text(). If you need to change the final link, you’ll have to reproduce the replacement outside this class or patch the plugin.

I am sorry I can't be of better help regarding this problem.

Best Regards,
Otto