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
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 -

Supporter timezone: Europe/Zagreb (GMT+02:00)

Tagged: 

This topic contains 3 replies, has 0 voices.

Last updated by Dražen 4 days, 1 hour ago.

Assisted by: Dražen.

Author Posts
August 29, 2025 at 9:12 am #17357314

lsbfS

Background of the issue:
I am working on a site under development and trying to translate pages using the WPML plugin. I encountered issues with custom Gutenberg blocks after translation.

Symptoms:
Issues with custom Gutenberg blocks after translating pages using WPML.

Questions:
How can I resolve issues with custom Gutenberg blocks after translation using WPML?

August 29, 2025 at 9:33 am #17357464

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

I created a minimal installation of WordPress, WPML, and all necessary WPML add-ons, and themes.

You can access the WordPress dashboard using the link below:

- hidden link

Try to replicate the issue with a simple example page.

Regards,

Drazen

August 29, 2025 at 9:37 am #17357543

lsbfS

Hi, I have created a sample page with a custom block.
Page name: Custom Block

Edit page URL:
hidden link

It is showing an "Attempt Block Recovery" error there.

Screenshot from 2025-08-29 15-06-48.png
August 29, 2025 at 10:05 am #17357696

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks, I checked further, and it seems to be an issue with translate block content and your custom code.

For example, in this test page: hidden link, if you check the code stored attribute and the rendered HTML don’t match. HTML has text from default language.

Attribute in the block comment: btntext: "View all testimonials es"

Actual inner HTML: <a>View all testimonials a</a>

Gutenberg validates by comparing the editor’s expected markup (from the attributes) with the saved HTML. Since it does not match, it flags the block as invalid.

If you adjust this manually in code view, you will see block is working fine.

Please check with your developer further and adjust the code, to ensure the block defines the attribute from the anchor text. I can not debug your whole custom code, but most likely in block.json (or registerBlockType) and in your save() function render.

Regards,
Drazen