Skip to content Skip to sidebar

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

Problem:
You are trying to translate the IDs of Gutenberg group blocks using the Advanced Translation Editor (ATE), but the IDs do not appear for translation. You have changed the group blocks from the default div to a section tag, and despite using a snippet to enable ID translation, it is not working.
Solution:
We recommend the following configuration to enable the translation of anchor IDs in Gutenberg blocks:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="core/group" translate="1">
      <xpath>//section/@id</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

Additionally, if the configuration does not take effect, try these troubleshooting steps:
1. Ensure you have removed any previous entries from WPML settings.
2. Check that your wpml-config.xml file is correctly added and properly structured.
3. Temporarily switch to a default theme, such as Twenty Twenty-Three, then re-activate your current theme to see if this resolves the issue.
4. Optionally, remove the wpml_config_files_arr entry from the wp_options table and reactivate the WPML plugin to force a reload of its config files.
Always back up your database before making these changes.

If this solution does not resolve your issue or seems outdated, 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 needed, please open a new support ticket at WPML support forum for further assistance.

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 8 replies, has 3 voices.

Last updated by uweW-7 2 months, 1 week ago.

Assisted by: Andrey.

Author Posts
July 7, 2025 at 12:44 pm #17208771

uweW-7

Background of the issue:
I'm trying to translate the IDs of Gutenberg group blocks with the ATE. However, the IDs don't show up for translation in the ATE. My groups are changed from the default div to using a section tag. I've found the following snippet, which supposedly should add the possibility to translate IDs, but it isn't working: <code><wpml-config><gutenberg-blocks><gutenberg-block type="core/group" translate="1" label="Anchor ID"><xpath>//section[@id]</xpath></gutenberg-block></gutenberg-blocks></wpml-config></code> I've also tried a variant with <code><xpath>//section/@id</xpath></code> which isn't working either.

Symptoms:
I expected to see input fields to translate IDs in the ATE. Instead, I got no change at all.

Questions:
How can I translate anchor IDs in Gutenberg?

July 7, 2025 at 1:53 pm #17209161

uweW-7

Hi,

I'm not using any plugin named PowerPack. Is this a part of WPML core?

Regards,
Mareike

July 7, 2025 at 2:41 pm #17209437

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Thank you for contacting WPML support. While you wait for one of my colleagues to take this ticket and work on it, let me provide you with the first debugging steps or see if I can help with the issue quickly.

I apologize, the reply about Powerpack was sent to you in error. (I deleted it.)

Please check our following guide on Register Custom Page Builder Widgets for Translation.

https://wpml.org/documentation/support/language-configuration-files/how-to-register-page-builder-widgets-for-translation/

Additionally, the guide on Registering Custom Elementor Widgets for Translation Using the Multilingual Tools Plugin can greatly assist you in achieving your goal. Please read about it here.

https://wpml.org/documentation/support/multilingual-tools/registering-custom-elementor-widgets-for-translation/

Regards,
Itamar.

July 7, 2025 at 2:59 pm #17209582

uweW-7

Hi,
thanks for the clarification!

We're not using any page builders or custom blocks. It's just core WordPress with the Gutenberg editor.

To reproduce:
- add a group block
- change the HTML element in the advanced settings from div to section
- add an ID / HTML anchor to the group
- translate the page using ATE

The anchors don't show up as translatable. They are manually translatable using the WordPress editor, but those changes are overwritten as soon as I use the ATE again.

July 7, 2025 at 7:01 pm #17210977

Andrey
WPML Supporter since 06/2013

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

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

Thank you for the details.

I will take a look at this and let you know as soon as I have more information.

July 8, 2025 at 8:55 am #17212554

Andrey
WPML Supporter since 06/2013

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

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

I have done a few tests, and the following config should work:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="core/group" translate="1">
      <xpath>//section/@id</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

I have attached the screenshots for your review.

Advanced-Translation-Editor-WPML(8).png
Screenshot 2025-07-08 at 11.53.46.png
July 8, 2025 at 1:33 pm #17214271

uweW-7

Thanks for your reply!

This works if I add it to the WPML-Settings directly in WordPress. It doesn't work for me however, if I add a wpml-config.xml to the root folder of my theme containing the same code and deleting the previously added code in WPML. Is this a caching issue maybe? Or am I missing something else?

July 8, 2025 at 1:47 pm #17214312

Andrey
WPML Supporter since 06/2013

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

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

It’s completely fine to leave the configuration in WPML settings—it won’t be removed when you update WPML plugins.

I’m not entirely sure why it isn’t working with your current theme, but here are a few troubleshooting steps you can try:
1. Make sure you have removed the entry from WPML settings, as intended.
2. Confirm that your wpml-config.xml file is correctly added and properly structured.
3. Temporarily switch to a default theme (e.g., Twenty Twenty-Three), then re-activate your current theme to test if this resolves the issue.
4. Optionally, you can remove the wpml_config_files_arr entry from the wp_options table and then reactivate the WPML plugin—this effectively forces WPML to reload its config files.

Please remember to back up your database before making these changes.

July 11, 2025 at 12:23 pm #17227964

uweW-7

Switching the theme temporarily did the trick! Thank you!