This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is experiencing incorrect URL redirections on their website, where URLs intended to redirect to a specific page are instead redirecting to unrelated pages. This issue was initially suspected to be related to the Rank Math plugin but was confirmed to be caused by WPML.
Solution:
1. Ensure a full backup of the website is available.
2. Disable all plugins except for WPML and switch to the default WordPress theme to check if the issue persists.
3. If the redirection issue continues, disable WPML plugins to verify if the problem is resolved.
4. Apply a temporary code fix by adding the following to the functions.php file:
add_filter( 'wpml_is_redirected', function( $redirect, $post_id, $q ) {<br /> if ($q->query_vars["p"] && $q->query["post_type"] == "treatments"){<br /> $permalink = get_permalink($post_id);<br /> if (strpos($q->query["name"], $permalink)){<br /> return $redirect;<br /> } else {<br /> return false;<br /> }<br /> }<br /> return $redirect;<br />}, 10, 3 );If these steps do not resolve the issue or if the solution seems outdated or irrelevant to your 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 problem persists, please open a new support ticket.
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.
This topic contains 15 replies, has 1 voice.
Last updated by 9 months, 2 weeks ago.
Assisted by: Lucas Vidal de Andrade.