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.

Our next available supporter will start replying to tickets in about 0.53 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: Asia/Singapore (GMT+08:00)

Tagged: 

This topic contains 70 replies, has 2 voices.

Last updated by Kor 6 months, 2 weeks ago.

Assisted by: Kor.

Author Posts
April 19, 2024 at 2:44 pm #15544364

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

Our second-tier support has recommended a workaround, which I've implemented on your website. However, please continue to avoid using special characters in the product URL slug and it should fix the other broken links. Additionally, I've noticed that the domain ellasbubbles.de is not validated here hidden link , as indicated in the attached screenshot. It would be advisable to address this issue.

Open the app/public/wp-content/plugins/seo-by-rank-math/includes/modules/woocommerce/class-product-redirection.php file
Inside RankMath\WooCommerce\Product_Redirection::remove_base_from_url(), around line 139:

$link = trim( str_replace( Helper::get_home_url(), '', get_permalink() ), '/' );

With:

// WPML -  Workaround for compsupp-7311
$home_url = Helper::get_home_url(); 

if ( 
	Sitepress::get()->is_active() &&
	$sitepress_settings['language_negotiation_type'] == 2
) {
	$home_url = get_home_url();
}

$link = trim( str_replace( $home_url, '', get_permalink() ), '/' );
Screenshot_410.png
April 26, 2024 at 4:59 pm #15571498

tannerT

Hi Kor, I am going through all the pages one by one to verify if the patch works.

Thank you.

April 26, 2024 at 5:49 pm #15571606

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

You're welcome.

Absolutely, just a heads up: make sure to replace all special characters in your product URL slugs. If you don't, the links will remain broken.

April 26, 2024 at 8:24 pm #15572115

tannerT

I did that long ago with a few products but that didn't fix the broken links issue. Will do that again.

April 28, 2024 at 6:41 pm #15574255

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

Alright then, please let me know how it goes.

April 29, 2024 at 6:45 pm #15578535

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

I'd like to provide an update on this matter. I've received additional feedback from our 2nd Tier Support team as well as from the author of the RankMath Plugin.

To further address this issue, please create a support ticket at the following link: hidden link . In your ticket, include comprehensive details about the issue and provide access to the staging environment. The RankMath team will investigate this matter thoroughly for you.

You can refer to this errata for our reference: https://wpml.org/errata/rank-math-seo-remove-base-option-causes-redirection-issues/

May 1, 2024 at 2:38 pm #15584251

tannerT

I still have a lot of broken list, I have included a file here for you to check the current status

hidden link

May 1, 2024 at 5:53 pm #15584743

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for your patience.

Upon review, it appears that a crucial step was overlooked in resolving the issue. As mentioned earlier, it's essential to "replace all special characters in your product URL slugs. If you don't, the links will remain broken"

I have rectified this for the product at hidden link. Now, the "es-us" language should function correctly at hidden link .

For a detailed demonstration of the steps taken to fix it, please refer to this screen recording: hidden link

May 2, 2024 at 4:19 pm #15588499

tannerT

Hi Kor, thanks. I am checking the video.

May 6, 2024 at 2:18 pm #15597878

tannerT

Hey Kor, I'm updating all links to remove the special characters. I should be able to report back to you within a day or two.

May 6, 2024 at 2:19 pm #15597882

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

No problems at all. Please take your time.

The topic ‘[Closed] lots of broken links when switching between the language’ is closed to new replies.