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:
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.
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?
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.
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.
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.
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?
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.