Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Bobby 1 year ago.

Assisted by: Bobby.

Author Posts
June 24, 2024 at 3:41 pm #15808932

katrinaC-2

Background of the issue:
We have multiple ACF link fields on our site that are nested in a group and set to translate. The text in the link output is translating appropriately however the URL is not updating to the corresponding translated page. The json output for one of those grouped link fields is pasted below for your reference (see field_front_page_intro_button).

Per other threads I've found, I've tried updating the page with a small change, clicking Update, then allowing the automatic translations to run. Doing so updates the link text appropriately but the URL remains unchanged.

{
            "key": "field_front_page_intro",
            "label": "",
            "name": "intro",
            "aria-label": "",
            "type": "group",
            "instructions": "",
            "required": false,
            "conditional_logic": false,
            "wrapper": {
                "width": "",
                "class": "",
                "id": ""
            },
            "wpml_cf_preferences": 1,
            "sub_fields": [
                {
                    "key": "field_front_page_intro_content",
                    "label": "Content",
                    "name": "content",
                    "aria-label": "",
                    "type": "wysiwyg",
                    "instructions": "",
                    "required": 1,
                    "conditional_logic": false,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "toolbar": "basic",
                    "media_upload": 0,
                    "wpml_cf_preferences": 2,
                    "tabs": "all",
                    "default_value": "",
                    "delay": 0
                },
                {
                    "key": "field_front_page_intro_button",
                    "label": "Call to Action",
                    "name": "button",
                    "aria-label": "",
                    "type": "link",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": false,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "return_format": "array",
                    "wpml_cf_preferences": 2
                }
            ],
            "layout": "block"
        },

Link to a page where the issue can be seen: hidden link

Symptoms:
The first blue link found on the page (Conoce el CNYCF) should be linking to the Spanish translated page at hidden link. Instead, it is linking to the default language page at hidden link. The link text updates appropriately when making changes, but the URL remains unchanged.

Questions:
Why is the URL not updating to the corresponding translated page?
How can I ensure the URL updates to the translated page instead of showing the default language URL?

June 25, 2024 at 1:12 am #15813275

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Please review the ACF custom field and let me know what is the current setting for it?
I want to ensure the URL field is not set to "copy" as that would always copy the original URL into the translation.

Also, if you edit the translation, at the top left there is a search area (within the Advanced Translation Editor), search for the URL there, are you able to locate it?

June 26, 2024 at 2:38 pm #15834973

katrinaC-2

Hi Bobby,

Thanks for your response.

As seen in the json output above, the ACF Link field is wrapped in a group that is set to "copy" and the Link field itself is set to "translate".

I am able to find the link url in the Advanced Translation Editor when searching but, given the link's target page is a translated page, I would expect it to be able to automatically identify the translated version of that internal link. Is this possible? Our site is 200+ pages and manually updating these links via search, for multiple languages, is just not very realistic.

Appreciate your assistance.

June 26, 2024 at 6:26 pm #15836664

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for updating me!

As a test what are your results if you do update the link in the ATE editor manually ?

Does it work Ok then?

Also, since the URL link is pointing to an internal URL, please try this:

1. Switch it's translation option from "translate" to "do not translate".

2. Make a small edit to the default language and update -> update the translation.

Is the URL working OK now?

Let me know your results, please.

The topic ‘[Closed] ACF Link field is translating link text but not URL’ is closed to new replies.