Skip Navigation

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

Problem:
The client reported that the English version of the "News" page was visible despite there being no direct translation. This issue was related to how WordPress and WPML handle blog pages, where if a blog page is not translated, it might still display content from the default language.

Solution:
We proposed two solutions:
1. Implement a 301 redirect from

https://www.uniaudit.it/en/news/

to

https://www.uniaudit.it/news/

. This can be done using a plugin or by adding an entry in the

.htaccess

file.
2. Create a translation of the "News" page in English and then set it to Draft or Private to ensure it exists but is not publicly accessible.

Additionally, we advised clearing all caches after making significant changes, especially since the client was using the SiteGround "Speed Optimizer" plugin.

If these solutions do not resolve your issue or if they seem outdated, we recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.

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.

Tagged: 

This topic contains 16 replies, has 2 voices.

Last updated by Mihai Apetrei 6 months, 2 weeks ago.

Assisted by: Mihai Apetrei.

Author Posts
July 8, 2024 at 12:54 pm #15913286

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hi there.

Thank you so much once again for your patience while we investigated this issue further.

After thorough debugging and consultation with our developers, we have identified the nature of the issue and would like to propose a couple of solutions.

1. Issue Identification:

- The English version of the "News" page exists despite there being no direct translation. This behavior is related to how WordPress and WPML handle blog pages. By default, if a blog page is not translated, it might still display content from the default language.

- The `hreflang="en"` attribute is set on this untranslated page, indicating its presence.

2. Proposed Solutions:

- 301 Redirect: One straightforward solution is to implement a 301 redirect from `hidden link` to `hidden link`. This can be done using a plugin of your choice or by adding an entry in the `.htaccess` file. This will ensure that users trying to access the English version are redirected to the Italian version.

- Translate and Set as Draft/Private: Another option is to create a translation of the "News" page in English and then set it to Draft or Private. This way, the page exists but is not accessible to the public.

3. Additional Insights:

- Our developers noted that blog pages can sometimes show posts from the default language if they are not explicitly translated or duplicated. This behavior ensures that no content is left completely inaccessible but can sometimes cause confusion.

- The developers also found that the custom code in your theme responsible for adding language-specific classes to the `<body>` tag is functioning correctly and not causing the issue.

4. Caching:

- It was initially suspected that caching might be causing some issues. Although we did not find conclusive evidence, it's always a good practice to clear all caches after making significant changes. Since you mentioned using the SiteGround "Speed Optimizer" plugin, please ensure that all caches are cleared.

Next Steps:
Please let us know which solution you would prefer to implement, or if you need further assistance with either of the suggested solutions. If you choose the redirect option, we can guide you through the steps to set it up.

Thank you once again for all the patience that you shown.

Mihai

July 9, 2024 at 7:26 am #15918515

gianfrancoa-3

Hi Mihai,
thank you very much for your detailed answer.

So:

The English version of the "News" page exists despite there being no direct translation. This behavior is related to how WordPress and WPML handle blog pages. By default, if a blog page is not translated, it might still display content from the default language.
>> mmm, I guess maybe WPML should handle blog pages a little better, but onestly it's not a big deal 🙂

_301 Redirect: One straightforward solution is to implement a 301 redirect from `hidden link` to `hidden link`. This can be done using a plugin of your choice or by adding an entry in the `.htaccess` file. This will ensure that users trying to access the English version are redirected to the Italian version.
>> ok, I've set the redirect right now.

Our developers noted that blog pages can sometimes show posts from the default language if they are not explicitly translated or duplicated. This behavior ensures that no content is left completely inaccessible but can sometimes cause confusion.
>> yes, it causes a bit of confusion, so maybe your developers should try to fix it in the next releases... anyway, it's not that big issue.

Please let us know which solution you would prefer to implement, or if you need further assistance with either of the suggested solutions. If you choose the redirect option, we can guide you through the steps to set it up.
>> yes, I've chosen the redirect option and I've already easily implemented it since I got Yoast Premium on my website 🙂

In the end, my issue is now solved and I REALLY thank you for all the work you've done 🙂
As a final thing, maybe you could report this small issue with WPML and untranslated blog pages to the developers so maybe they can fix it in future releases.

Again, really thank you for your help 🙂

July 9, 2024 at 11:47 am #15920466

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hi there.

I am very happy to hear that you managed to get this resolved by using the redirection steps.

My colleagues are aware of this weird behaviour now; thank you so much once again for your patience throughout the whole debugging process.

Can you also please mark this ticket as resolved?

Have an amazing rest of the day!

Mihai

July 9, 2024 at 11:58 am #15920579

gianfrancoa-3

Sure, I confirm that my issue is resolved.
Thanks!