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.

Elementor users - please update WPML to the latest version to maintain compatibility. More details here - https://wpml.org/changelog/2024/12/wpml-4-6-15-critical-update-for-elementor-sites/
Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 -
- 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 -

Supporter timezone: Asia/Kathmandu (GMT+05:45)

This topic contains 0 replies, has 1 voice.

Last updated by ronaldT-5 22 hours, 16 minutes ago.

Assisted by: Shekhar Bhandari.

Author Posts
December 27, 2024 at 8:21 am #16548108

ronaldT-5

Background of the issue:
I am trying to use the Yoast Redirects feature, but it becomes unstable when the WPML SEO plugin is active. Yoast suggested I contact you. I cleared the WPML Cache, but it didn't help. The issue can be seen at: hidden link

Symptoms:
Errors occur upon saving the new redirects when both WPML SEO and Yoast SEO Premium are active. And when I click "Save Anyway" upon the error, the domain of the Redirect To URL becomes missing. My Redirect To URLs I'm having issues with are located on a different domain (French one vs the primary English one)

Questions:
Why do Yoast Redirects become unstable with WPML SEO plugin active?
How can I resolve the errors when saving new redirects?

December 27, 2024 at 9:37 am #16548292

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Can you disable the WordPress guess redirects and see if the problem solves on your end.

You can add the following code to your functions.php, once saved go to settings->permalinks, update the permalinks and see if it helps

add_filter('do_redirect_guess_404_permalink', '__return_false');

Look forward to your reply.

Thanks

December 27, 2024 at 4:14 pm #16548917

ronaldT-5

Interesting! I never received an email notification about your reply.

The functions.php code offered here is how I can disable guess redirects?

Where to add the code within functions.php file?

If I input it at the end of the file, as follows, it literally crashes my site:

/**
* WPML code to fix Yoast SEO Redirects mishap
*
*/
add_filter('do_redirect_guess_404_permalink

Looking forward to your reply.

December 27, 2024 at 7:22 pm #16549142

ronaldT-5

Shouldn't there be a closing parenthesis at the end of the code as well as an end quote??

add_filter('do_redirect_guess_404_permalink')

December 27, 2024 at 7:27 pm #16549174

ronaldT-5

Here's what I found on the Internet of things:

Disable 404 redirect guessing

The do_redirect_guess_404_permalink filter can now be used to completely disable redirect guessing. Returning false to the filter will disable the feature entirely.

Example

1
add_filter( 'do_redirect_guess_404_permalink', '__return_false' );

December 27, 2024 at 7:47 pm #16549186

ronaldT-5

Okay, I just tried the new code. It works, but only partially. For whatever reason, Yoast SEO adds a slash (/) before the HTTPS:

Screenshot 2024-12-27 at 2.46.49 PM.jpg