Skip to content Skip to sidebar

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

Problem:
You are trying to set up redirects to the default language page if some content is not translated to all languages or if a translation is missing. The Spanish version of a page is accessible even though the content is not translated.
Solution:
If you're experiencing this issue, we recommend checking if you have enabled the settings to display untranslated content for pages in secondary languages. For more information, visit: Displaying Untranslated Content on Pages in Secondary Languages.
To adjust this setting, navigate to WPML → Settings. Scroll down to the "Post Types Translation" section and select "Translatable - only show translated items" for Pages post types. Additionally, in WPML → Languages → Language Switcher Options, you can choose how to handle languages without translations.

This solution might be irrelevant if it’s outdated or not applicable to your case. We highly 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 the issue persists, 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.

This topic contains 15 replies, has 0 voices.

Last updated by Andrey 1 year, 5 months ago.

Assisted by: Andrey.

Author Posts
November 6, 2024 at 7:15 pm #16374462

rabiaE

Background of the issue:
I am trying to set up redirects to the default language page if some content is not translated to all languages or if a translation is missing. For example, the blog page hidden link is available in English but not in Spanish. However, the Spanish page hidden link is still accessible.

Symptoms:
The Spanish version of a page is accessible even though the content is not translated.

Questions:
How to set redirects to the default language page if some content is not translated?
Why is the Spanish page accessible even though the content is not translated?

November 6, 2024 at 9:27 pm #16374745

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for contacting WPML support.

You may have enabled the settings to display untranslated content for pages in secondary languages.

For more information, visit:
https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/

To adjust this setting, go to the WPML → Settings page. Scroll down to the "Post Types Translation" section and select the first option, "Translatable - only show translated items," for Pages post types.

Additionally, in WPML → Languages → Language Switcher Options, you can choose how to handle languages without translations.

I hope you find this helpful.

Settings-‹-woosite-—-WordPress(1).png
November 7, 2024 at 3:24 am #16375067

rabiaE

Thanks for the quick reply Andrey.

Actually we had enabled secondary language posts earlier and now we don't want them but we can still access those secondary posts after disabling language switcher in default language page. So now all the secondary language posts should be redirected to default language posts. That's what we want. We basically don't want to enable any secondary language posts for the blogs. We want to display only English content for all the blog posts.

For example there is no language switcher enabled on this hidden link blog post, but you can still access its Spanish language version at hidden link

As I mentioned above we previously enabled secondary language posts, but now we have disabled them by selecting the "Not translatable" option for posts in the backend under WPML → Languages ​​→ Post Type Translation

Please let me know if it's clear now. Thanks

November 7, 2024 at 2:40 pm #16378236

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for the explanation.

From what I understand, those posts do not have translations. Why not select the option "Translatable - only show translated items"? In that case, if a post does not have a translation, it should be redirected (based on what you chose on WPML → Languages → Language Switcher Options).

Please clarify what you mean by "no language switcher enabled on this"?

I have enabled debug information for this support ticket. Please follow this link for instructions on retrieving this information from your site and provide it to us: http://wpml.org/faq/provide-debug-information-faster-support/.

November 7, 2024 at 7:23 pm #16379788

rabiaE

I tried to select the option "Translatable - only show translated items"? but nothing worked.
"no language switcher enabled on this" we don't want any language switcher on the blog posts, so we disabled it by selecting the "Not translatable" option for posts in the backend under WPML → Languages ​​→ Post Type Translation

Thanks

November 7, 2024 at 7:33 pm #16379840

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

I tried to select the option "Translatable - only show translated items"? but nothing worked.

I have just tested this locally with a non-translated post and have redirection. For example, if I type the following: hidden link, it will redirect to hidden link.

What are your settings under Settings → Permalinks? Have you tried disabling all plugins temporarily except for WPML to see how it works?

November 8, 2024 at 2:41 am #16380400

rabiaE

Yes, Issue is still there even after deactivating all the other plugins except for WPML.
Also please see the attached screenshot for the current permalinks setting.

I can provide you logins if you want to try at your end. FYI, I've already created the backup of the site.

Thanks

Screenshot 2024-11-08 075208.png
November 8, 2024 at 8:13 pm #16383474

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback. Do you have any caching mechanisms enabled on your website? If so, could you please clear all caches and test it again?

When I access the URL like this: hidden link, I encounter a redirection on your site. Can you confirm whether there is no Spanish translation for this post?

November 9, 2024 at 5:10 am #16383802

rabiaE

Yes, We have cache mechanism enabled on the server and we already cleared the cache several times.
And you're trying to access different language URL in French language. Please access this hidden link
Why it isn't redirecting? Please let me know. Thanks

November 9, 2024 at 10:01 am #16384198

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Can you confirm if there is no Spanish translation for the post in question?

It was a test with a language code that doesn't exist on your site. To check if redirecting will work in such cases.

November 9, 2024 at 11:52 am #16384347

rabiaE

Please check the attached screenshot. I don't see in Spanish translation for this hidden link post, but still you can access hidden link

Thanks

Edit Post “Guide to Commercial Truck Tire Wear by Type” ‹ Service Ti_ - www.sttc.com.png
November 11, 2024 at 9:16 pm #16390223

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback.

I do not see the language sidebar at all. Did you set the post type to "Not translatable" in WPML → Settings? If yes, please temporarily activate it and check if the post has a translation. You can delete the Spanish post translation if it exists.

November 12, 2024 at 4:00 am #16390697

rabiaE

I unchecked "Not translatable" option and checked "Translatable (use translation if available or fallback to default language)" option. See the attached screenshot how it looks now.
Also please check the screenshot of the post from the backend and let me know what should I do. I don't see any Spanish content in the backend. But still it's showing language switcher on the frontend and redirect isn't working at all.

hidden link

Let me know. Thanks

Edit Post “Truck Maintenance Basics_ Tips for Keeping Your Fleet on _ - www.sttc.com.png
Screenshot 2024-11-12 091516.png
November 12, 2024 at 1:15 pm #16392822

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

But still it's showing language switcher on the frontend and redirect isn't working at all.

The redirect will not work because you selected the option "Translatable (use translation if available or fallback to default language)." Please test it with the first option, "Translatable—only show translated items."

If it's still the problem, I need to request temporary access (wp-admin and FTP) to your site—preferably to a test site where the problem has been replicated—in order to be of better help. When you log in to leave your next reply, you will find the needed fields below the comment area. The information you will enter is private, meaning only you and I can see and access it.

November 12, 2024 at 2:28 pm #16393266

rabiaE

Ok so finally it worked.
I'm not sure why it didn't work at first when I selected the same option. Maybe there must be some cache issue. Now it's working as expected. So all good now.
Thanks for your help on this Andrey.