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: Exception
This topic contains 33 replies, has 1 voice.
Last updated by kristoferS-2 4 days, 6 hours ago.
Assisted by: Andreas W..
| Author | Posts |
|---|---|
| April 23, 2026 at 7:44 am #17989339 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
This is because your config allows translating the IDs of those Headings. If the IDs are not translated, the anchor links will not work. The Generate Blocks Team would need to update their wpml-config.xml file in this case, to always allow translating the IDs. The same counts for our config for the Gutenberg heading block: <gutenberg-block type="core/heading" translate="1"> <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]</xpath> </gutenberg-block> It only considers the text, not the IDs. I suppose that this is expected in this case, as most users might not expect that they need to translate the IDs. This is why we allow adding a custom XML config for specific use cases. I suggest that, for now, you keep using the custom config for your use case. I am following up with our compatibility team about whether the behavior is currently expected or if it would be something we would adapt. |
| April 23, 2026 at 8:18 am #17989561 | |
|
kristoferS-2 |
I have had XML config to allow translating the id attribute on both Gutenberg and GeneratePress heading blocks for a long time. The heading ids are visible in ATE as well. While investigating this myself I added XML config for the href attribute on buttons. That seemed to have some effect. See previous messages. Thank you for checking with the compatibility team. |
| April 23, 2026 at 8:25 pm #17991253 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
According to our compatilbity team, the reported behavior is expected. We do not consider those IDs by default to be translatable, as this is expected by the majority of users. If you need to translate those IDs, you can use a custom XML configuration. |
| April 24, 2026 at 7:22 am #17991823 | |
|
kristoferS-2 |
I think the team misunderstood my issue. I know that IDs are not translated by default. That is why I have added them to my XML config long before this ticket. They do show up in ATE. My issue isn't even with ID attrbutes, it is with HREF attributes referring to those IDs In my site there seem to be a case where the translation of href attributes are reverted to that of the original, event if the IDs and HREFs are shown in ATE. Have you had time to check my staging site? See previous messages for repro steps. |
| April 24, 2026 at 7:29 pm #17993765 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
There are two elements that need translation for this functionality: 1) The ID selector You can simply not translate both, and the links should work. If you translate one element and not the other, the links break. The only thing I could confirm is that the links are not working if you are not using an XML config to translate the ID. |
| April 25, 2026 at 7:17 am #17994284 | |
|
kristoferS-2 |
Thank you. I thought that links should not need to be added to XML config since ATE seem to pick them up regardless. If I indeed need XML config for links as well - can you make one that works for any type of block and not just buttons? |
| April 26, 2026 at 12:09 am #17994919 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
1) You need a specific config to translate the IDs. We do not cover this by default. 2) The anchor links like "#contact" should always be translatable, but it might be the case that by default, they will not appear inside the Advanced Translation Editor. You might need to search for them first in the text search field on the top right. Anyhow, it would not be recommended to translate those anchor links unless you use a custom config to translate the IDs. --- What exactly are you expecting in your use case? Please provide an exact example. |
| April 27, 2026 at 8:14 am #17996059 | |
|
kristoferS-2 |
Please confirm that you understand that XML config for translating IDs was there from the beginning. I mentioned this a few times now - but from your replies it sounds to me like you think these are missing. Given that I have XML config for translating heading IDs, I expect these to be visible in ATE. I also expect links to be visible in ATE without any custom configuration. Both of these are true. When updating the original page, I expect the translated links to be applied in the translated page. What I observe, is that they are not if the change to the original was style/layout only. If I make a second edit on the original, the links will be updated. |
| April 28, 2026 at 10:56 am #17999517 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
The IDs were translatable, as you used a custom config at WPML > Settings > Custom XML Configuration. Our devs do not include those IDs by default on purpose. You will need to use a custom XML configuration for your use case. |
| April 28, 2026 at 11:07 am #17999528 | |
|
kristoferS-2 |
What about the links (href attributes)? Are custom configuration needed for that as well? As I mentioned before, my experience is that links are always visible in ATE. But if I make a style change only to the original, links will be overwritten with that of the original in the translation. Did you check my repro steps in my staging site? |
| April 28, 2026 at 12:59 pm #17999845 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Your steps included: The links will not work if I remove the XML config, and this is expected, as without the XML configuration, the IDs will not be translated. If I did not understand the issue correclty, please let me know on which content on your site this issue can be replicated, and name me the exact steps. |
| April 28, 2026 at 1:13 pm #17999901 | |
|
kristoferS-2 |
Thank you for clarifying. "Remove the XML workaround for button blocks" was referring to my workaround adding '//a/@href' to the XML config, not IDs on headings. As of today the issue is slightly different. I noticed a pending update for WPML but that does not seem to make a difference. Added login information to the private form. I updated Step 1 below. At first the repro steps was that under 'Yesterday'. At some point, they changed to those under 'Today'. Yesterday: Today: |
| April 28, 2026 at 1:55 pm #18000076 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
You are saying: If you first use a config for the links and then remove this config, it might be expected that they will no longer be translated. Anyhow, there should not be a need for any config for links. In doubt, you can always search the links inside the text field on the top right of the Advanced Translation Editor. |
| April 28, 2026 at 2:26 pm #18000152 | |
|
kristoferS-2 |
The XML for HREF attributes was not there when I found the issue or when the links was originally translated. I added it on advise from your chat bot. It seemed to fix or workaround the issue. But like you say - it should not be needed. |
| April 29, 2026 at 8:18 am #18001834 | |
|
Andreas W. WPML Supporter since 12/2018
Languages: English (English ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
I can not confirm this on my test site. I just need to search the link in the top right text field inside the Advanced Translation Editor and translate it. No config needed. One-Click-Login: The config for the ID will be needed, as our devs do not cover it on purpose. |