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.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Nigel 3 months ago.

Assisted by: Nigel.

Author Posts
October 20, 2023 at 8:34 am #14621667

Tobias

hidden link

exists. Note the "/de/" -> language German

It is of post type X.

Post type X is set to "not translatable" in WPML settings.

When the url is changed from "/de/" to "/es/", so Spanish requested instead of German, the German page is returned with a response header of 200 but the HTML language attribute is set to "es". A response header of 404 was expected. Note: "Spanish" is part of the languages enabled for the domain. If I use "/pl/" (Polish), which is not enabled for the domain, I receive a response header of "301 Moved" and am redirected to "/de/".

Is this WPMLs doing due to the settings of the post type being "not translatable"?

Can we change this behavior to force a redirect or a 404 ?

October 23, 2023 at 8:05 am #14633895

Nigel
Supporter

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

Hi there

I just visited the link you shared, and then I manually changed the URL to replace /de/ with /es/ (there is no language switcher because the post type is not translatable and there is nothing to switch to).

I had the expected behaviour, rather than what you describe.

As you can see in the screenshot I was redirected back to the /de/ URL.

I can see from the home page that Spanish is active on the site.

Perhaps you made some changes since submitting this ticket?

Screenshot 2023-10-23 at 08.58.27.png
October 23, 2023 at 8:31 am #14634211

Tobias

hmm, i still have the originally described behavior: see screenshots. And I am not logged in.
I'll ask the server admins about any redirects. My browser should be set to German but we have disabled the browser language redirect in WPML.

Screenshot 2023-10-23 102749.png
Screenshot 2023-10-23 102733.png
Screenshot 2023-10-23 102631.png
October 24, 2023 at 2:46 pm #14648807

Nigel
Supporter

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

Sorry, returning to this I realise I had tested a different URL (that I had arrived at from navigating the site menu, not the direct link you shared).

With the URL I visited, switching the URL to 'es', it is redirected to 'de'.

With the URL you shared, switching the URL to 'es' loads the German content, but at the 'es' URL with the html lang attribute set to 'es'.

The URL I visited is a page, your URL is a single post of some custom post type.

Could you clarify the translation preference setting for both pages and for the custom post type, perhaps you could share a screenshot.

October 24, 2023 at 2:52 pm #14648957

Tobias

Hi, yes, the URL I shared is a custom post type. It is set to non-translatable (the 3rd column in WPML settings).

The URL you visited is a default page and it is set to translatable.

sets2.png
sets1.png
October 25, 2023 at 8:06 am #14657807

Nigel
Supporter

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

OK, I have confirmed the details of the issue and escalated it to my colleagues in second tier for them to pursue further.

I would just point out that this is something of a hypothetical issue inasmuch as it requires manually guessing and entering wrong URLs, there are no links generated to navigate to such URLs, and so I wouldn't expect it to be a high priority with the developers.

That said, I will keep you posted with any progress on the issue.

January 24, 2024 at 7:46 am #15220012

Nigel
Supporter

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

Hi there

I'm just reviewing older escalated threads and realise I missed replying to you about this, sorry for that.

I had a reply at the time that this is how it has always worked, that with the "Do not translate" translation preference it is possible to access the original language version of the post via a secondary language url, and there wasn't any appetite to change that. The links don't appear in sitemaps or menus, and as such there don't appear to be any adverse consequences.

Again, sorry I didn't share this with you earlier.

January 24, 2024 at 8:16 am #15220081

Tobias

I thank you. I understand adverse effects are not expected. I agree. Nevertheless perhaps keep the ideas to deal with such case on a low priority.

Tobias confirmed that the issue was resolved on 2024-01-24 08:16:09.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.