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.

Author Posts
October 4, 2018 at 1:53 pm #2787732

guillaumeC-14

Hello,
I have issues with language related urls : language switcher, the preview link and the hreflang link all miss the language code.

For instance the pages hidden link and hidden link display fine.
But for both of them,
• The hreflang code (en-US fr-FR) is correct but the link is hidden link
• In the language switcher the other languages link is hidden link
• In the page edit, the preview link is correctly displayed but it links to hidden link

I also have another issue that I think is somehow related.
The primary language of my website is english. I have this page, hidden link that has a title, a few filters and then a listing of custom post types in the current language. In the english page it works just fine, but on the french page it gets weird : if I am logged into the wordpress admin, it works just fine. But if I am not, the page title and filters are the french ones, but the listed content are posts in english, and the filters don't display any result.

While looking for a fix, I noticed that the "_icl_current_language" cookie is correctly set to fr if I'm logged in, but set to "en" when I'm logged out.

This happens since I updated several outdated plugins last week-end.

October 5, 2018 at 11:29 pm #2791898

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thank you for contacting us. Please, my sincere apologies for the delay in answering.

This may be some caching system or some links/pages just need to be updated. Please follow the steps below:

- Click on the WPML > Support > Troubleshooting. Look at the "Clean up" e click on these buttons:
-- Clear the cache in WPML
-- Remove ghost entries from the translation tables
-- Fix element_type collation
-- Set language information
-- Fix post type assignment for translations

After following the steps above, please let me know if the problem is resolved.

Thank you.

October 8, 2018 at 10:50 am #2795662

guillaumeC-14

Hello Bruno, thanks for your answers.
I tried the clean up buttons but it didn't fix the issue.
I tried to disable every plugin and switch to the default theme, the problem was still there.
The issue only happens on my live website, everything is fine in both local and staging. I made researches to find out what settings weren't the same and could cause the issue, but didn't find anything.
I also forgot to mention that the issue is not happening on every page. Some pages that have no translation have the issue, some other don't. Some pages that have translations have the issue, some others don't.

October 8, 2018 at 11:15 pm #2797534

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you for the detailed explanation. I'll need to request temporary access (wp-admin and FTP) to your site - preferably to a test site where the problem has been replicated if possible - in order to be of better help.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Note:

*** Please let me know exactly what steps should I follow to see the problem.

*** Please, can I install the Duplicator or All in One Migration plugin to make a copy of your site and install it on my test environment? This will help me debug the problem.

*** Note: Please make a full backup of your site.

Privacy and Security when Providing Debug Information for Support: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Thank you.

October 10, 2018 at 7:55 am #2803254

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you. I think the problem is happening because you are using the "Use directory for default language" feature, but you are not creating the root page.

On the WPML > Languages > Language URL format, I noticed you were using the "A page" option. I selected the "HTML file" option and kept the field empty. At the moment it seems to be working. I'll attach two pictures for you to see.

If you want to use the "A" page, be sure to actually create a page and not just check this option. Note that you must create a page when you use the root page. You can see more in our documentation: https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/

Please, let me know if I can help with any other questions you may have. I'll be happy to help.

Thank you.

October 10, 2018 at 9:26 am #2803657

guillaumeC-14

Everything is resolved, thanks a lot !
I'm still curious why it happend only on specific pages but as long as it's fixed, I'm happy.
Thanks a lot for for efficiency on this.