Skip Navigation

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

Problem:
The client is using WPML with Rank Math's "Strip Category Base" option, which removes the word 'category' from the category slug. However, this causes an issue with the WPML language switcher on category pages, leading to 404 errors when switching languages because the switcher includes the word 'category' in the URL.

Solution:
We tested the functionality on a sandbox site and found that both the category link in the menu and the language switcher were working correctly. The issue may have been related to a delay on the CDN, which caused some links to point to the wrong address after changes were made. It could also be related to the Elementor switcher block. The client will test on their end without the CDN and with the Elementor version of the switcher to confirm if the problem persists. If the issue is still present without the CDN and with the Elementor switcher, the client is advised to open a new support ticket. For now, the problem is considered resolved.

If this solution doesn't look relevant to your situation, 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 2 replies, has 2 voices.

Last updated by Kor 10 months ago.

Assisted by: Kor.

Author Posts
January 29, 2024 at 4:27 pm #15239858

mariuszM-13

Anyway, I use WPML and Rank Math
in Rank Math I use the "Strip Category Base" option which basically removes the word CATEGORY from the category slug and it works great. But then there is a prolem with WPML language switcher that on every category page wants to redirect to another alnguage with the word "category" in the slug. Therefore it ends in 404

January 29, 2024 at 5:07 pm #15240017

mariuszM-13

Ok, I can wait for the sandbox site

January 29, 2024 at 5:54 pm #15240195

Kor
Supporter

Languages: English (English )

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

Thanks for your patience.

I've tested it here hidden link and it seems to work on the translated category too hidden link

Could you please check and see if I've configured anything incorrectly? Here is the login link hidden link

January 30, 2024 at 4:33 pm #15245631

mariuszM-13

I have added the top menu and a category link to it. Also the language switcher. And in the sandbox everything works well. Both the category link in the menu and the language switcher point into the same link.

In my case I also have elementor and CDN. It might have beed a delay on the CDN that caused some links to still pointing to wronk address after the change was made. It might have something to do with the switcher block in elementor. I will test it on my end then. If I find out that the problem still exists when using Elementor version of the switcher and without CDB, I will open another ticket. But for now the problem is solved.