Skip Navigation

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

Problem:
Automatic link translation fails in one specific custom field

Solution:
Make sure to register such custom field in XML config.

Relevant Documentation:
- https://wpml.org/documentation/support/language-configuration-files/#custom-fields

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.

Our next available supporter will start replying to tickets in about 6.10 hours from now. Thank you for your understanding.

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 2 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
August 25, 2023 at 6:43 pm #14293645

arnoP-3

Hi,

In one specific custom text field (created by Meta Box), internal links do not automatically get translated if the translation of the target page becomes available. The field text itself can be translated fine. So far I have seen this problem in 3 posts, only in that same field. Our workaround is that we translate the links manually.

What could be the reason this fails for that single field?

Kind regards,
Arno

August 26, 2023 at 12:44 pm #14294679

arnoP-3

I just noticed that the target links all point to the same custom post type. I'm not sure if that's a coincidence.

August 28, 2023 at 9:56 am #14299235

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Arno,

Thank you for contacting the support.

Can you please provide some more details like screenshots where this field is in the backend and where it is supposed to be displayed on the frontend?

Additionally, if this is the custom field, can you please also check and tell about the following?

- How are you displaying this field in the frontend? i.e. custom code, a page builder widget or etc.

- Is the field containing the link, is set translatable? See https://wpml.org/documentation/getting-started-guide/translating-custom-fields/ for details.

- Have you already translated the target page for which you are adding the internal link to the field? Or do you translate that target after adding link to the field?

Please let me know and I'll try my best to help you further on the matter.

Regards.

August 28, 2023 at 11:01 am #14299729

arnoP-3

Hi Waqas,

This is the situation:
1. We have a source page in English and we link to a target page that is available in English and German.
2. Later, we translate the source page to German.
3. Normally, the links in the source page don't require any manual modification, because WPML translates them. But in this case that doesn't happen with links in that particular field. In the German translation of the source page, they keep pointing to the English target page.

The text field ID is "activity_content_introduction_text". It is translatable (see screenshot). It is available in a Meta Box section in the backend and is rendered via a Meta Box View to the frontend. The View is inserted into a post template (Kadence Elements, using Gutenberg, no other page builder). All of this is probably not a problem because it's the same as many other fields we have, and I didn't notice issues there.

The links that fail all point to the post type "town", but that could be a coincidence.

If needed I can provide access to a staging copy.

Kind regards,
Arno

wpml_field_config.jpg
August 28, 2023 at 12:47 pm #14300961

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend. Specially another field which is working fine, so I can compare both accordingly.

IMPORTANT: Please take a complete backup of the site to avoid data loss.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

August 29, 2023 at 8:56 am #14305521

arnoP-3

Hi Waqas,

I solved the issue. I suddenly remembered the WPML Custom XML Configuration. The WPML link translator skips custom fields by default, so any fields it must process need to be added to the XML. I had done that before but not for this field.

I now added this to the section, and that fixed it:
activity_content_introduction_text

Thanks for your assistance!