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.

Sun Mon Tue Wed Thu Fri Sat
- 6:00 – 12:00 8:00 – 12:00 6:00 – 12:00 8:00 – 12:00 6:00 – 12:00 -
- 13:00 – 15:00 13:00 – 17:00 13:00 – 15:00 13:00 – 17:00 13:00 – 15:00 -

Supporter timezone: America/Lima (GMT-05:00)

This topic contains 2 replies, has 0 voices.

Last updated by Nicolas V. 2 weeks, 6 days ago.

Assisted by: Nicolas V..

Author Posts
December 20, 2024 at 1:20 pm #16534362

giedreS-2

Background of the issue:
I translated the listing on the website: hidden link and hidden link. I am trying to change the language using the language switcher.

Symptoms:
When I try to change the language using the language switcher, the /en/ is not added to the URL.

Questions:
What should I do to ensure the language switcher adds /en/ to the URL?

December 20, 2024 at 3:59 pm #16534903

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Welcome to the WPML support forum.

I couldn't find the language switcher on your site so I checked the source code of different pages. It seems that the issue is specific to this page.

I'm not sure what could be the issue here so let's try a few things:
1. Memory
Let's start by increasing your PHP memory allocation. The minimum requirement for WPML is 128M but we recommend 256M because Elementor and WooCommerce require 256M:
- Access your server via FTP and open wp-config.php (in your WordPress root directory).
- Insert those lines just before /* That's all, stop editing! Happy blogging. */

/* Memory Limit */
define( 'WP_MEMORY_LIMIT', '256M' );

2. SEO plugin
I noticed that you're using All In One SEO. Maybe you manually set the url the plugin settings. Please open the original page and the translation in the WordPress editor and check AIO SEO settings to make sure that you didn't overwrite the URL.

3. Cache
- Please purge all your caches
- Go to "WPML > Support > Troubleshooting" and click on "Clear cache in WPML".

Please let me know if this help.

December 23, 2024 at 9:15 am #16539611

giedreS-2

Hello,
Thank you for your response and the information provided.

I have tested all three methods, but unfortunately, they did not help. I have also enabled the language switch for you to perform further testing.

December 23, 2024 at 1:20 pm #16540518

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

In that case, could you please provide me with a temporary admin access (wp-admin and FTP) – preferably to a staging copy of your site where the issue has been replicated – so I can further investigate. I will activate a private field for your next answer where you can provide that information safely (this field is only visible by you and the support team). Don't share your own admin account, create a new one that you will delete when we finish troubleshooting.

IMPORTANT: Before we proceed, please backup your site and database.

December 27, 2024 at 1:44 pm #16548595

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for the access. I was able to see the issue. When visiting the listing the url is not translated in the language switcher. This means that when visiting the Lithuanian listing, the english flag will have the Lithuanian link and when visiting the English listing, the Lithuanian flag will have the English link.

I think that the issue is related to the link custom structure, where you add the listing_type in the url and Listing types are translatable. After further investigation, those post types and custom urls are coming from your theme "My listing".

Please note that this theme is NOT compatible with WPML, We’ve attempted to reach the author, but have not yet been able to establish cooperation.
REF: https://wpml.org/theme/mylisting/
Could you please contact them and invite them to join our Go Global program?

---

Because it's a production site I would not recommend to do more tests that could affect the site. I would recommend you to:
- Make a staging copy where you will be able to run some tests.
- Update all plugins: there are 24 updates, some plugins didn't get updated in a long time.
After that:
- Try to change the permalink structure
- When editing the listing, you can select the listing data (listing type) which will modify the permalink. I think the issue here is that you can select types from any language (I can select jmonés or companies). Maybe the listing type should not be translated?
- Report this issue to the author (providing access to the staging copy) and invite them to the Go Global program in case they need help to make their theme multilingual.

The topic ‘[Closed] Language switcher switch bad URL’ is closed to new replies.