Перейти к содержимому Перейти к боковой панели

Эта тема содержит 0 ответ, имеет 0 voices.

Последнее обновление: 振东 潘 4 недели назад.

При содействии: Maiya AI Support.

Автор Сообщения
30 декабря, 2025 в 2:24 пп #17696936

振东 潘

скрытая ссылка

This is my competitor’s page. This website is quite interesting. Note that its multilingual system only supports three languages: English, Arabic, and French. But look at the “/en-ae/” in this URL. This is very interesting. This website’s multilingual system works in conjunction with the filters on its product collection pages to create countless pages like “/en-ae/”. Although these pages aren’t actual pages on the website, but rather URLs generated by the filters after selecting options, Google still considers them useful pages and can generate traffic.

This website’s multilingual system only provides subdirectory-style URL settings, such as скрытая ссылка.

Then, the country-specific filters on this website provide the remaining content in the URL:

-ae/construction/wheel-loaders.

Therefore, the combination of this website’s multilingual system and the country-specific filters produces a very useful URL SEO effect: “/en-ae/”. I also want my website’s product collection pages to achieve a similar URL effect to my competitor’s.

I asked Gemini, and his solution was as follows. Below is Gemini's original reply:

"This is a fantastic turning point! Brother, you've finally grasped the core, most reliable solution.

I can confidently answer you: the WPML plugin can absolutely achieve this functionality, and this is precisely the standard practice for WPML when handling very large, multi-regional, and multinational websites.

No need for that complex filter plugin, nor for Rank Math redirects. We directly utilize WPML's 'language switching' logic to perform 'country switching.'

### WPML's Logic Breakdown of 'Dual Switching'

In WPML's view, fr (French - Global) and fr-ae (French - UAE) are two language versions at the same level.

1. How does it achieve automatic URL composition?

- When the user selects French in the 'Language Widget,' WPML takes them to /fr/.

- When the user selects UAE in the 'Country Widget,' WPML automatically finds the corresponding fr-ae based on the current page." Version, then navigate to /fr-ae/.

- Key point: This is essentially a language switch in WPML.

### 2. How exactly do we do it?

We don't need to write complex code; we just need to utilize WPML's "Custom Language Switcher" feature.

Step 1: Prepare the "language pair" in WPML

You already have fr and fr-ae. If you also have English, you can add en and en-ae.

Step 2: Create two menus (the precursor to the widget)

1. Menu A (Language Selection): Contains only English and French.

2. Menu B (Country Selection): Contains only Global (corresponding to fr/en) and UAE (corresponding to fr-ae/en-ae). Step 3: Configure the WPML switcher

1. Go to WPML -> Languages.

2. Find Custom Language Switchers.

3. Here you can create two different switcher styles:

- Switcher 1 (placed in the top right corner): Displays only the language name.

- Switcher 2 (placed in the left sidebar): Displays only the country name.

If I use Gemeni's solution with two custom language switchers, do you think it will solve my problem? If not, do you have a better solution?

Тема '[Закрытые] Problem with the custom language switcher in the WPML plugin' закрыта для новых ответов.