Skip to content Skip to sidebar

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

Problem:
The client experienced layout distortion on translated pages of their website, which uses Elementor and WPML. The issue was not caused by the iframe script used for embedding a contact form, as initially suspected, since similar distortion occurred on another contact page without the script.

Solution:
We identified the problem as a known compatibility issue between WPML and Elementor V4 Atomic Global Classes. To resolve this, we recommended the following steps:
1. Add specific entries to the site’s XML configuration via WPML > Settings > Custom XML. The entries to add are:

<wpml-config><custom-fields><custom-field action="copy">_elementor_global_variables</custom-field><custom-field action="copy">_elementor_global_classes</custom-field><custom-field action="copy">_elementor_global_classes_labels</custom-field><custom-field action="copy">_elementor_global_classes_order</custom-field></custom-fields></wpml-config>

2. Insert a PHP function into the child theme's functions.php file to handle unmapped global classes:

add_filter( 'elementor/atomic-widgets/settings/transformers/classes', 'wpmlsupp13746_resolve_unmapped_global_classes', 20, 1 ); function wpmlsupp13746_resolve_unmapped_global_classes( $classes ) { if ( ! is_array( $classes ) || ! class_exists( '\Elementor\Modules\GlobalClasses\Global_Class_Post' ) ) { return $classes; } foreach ( $classes as $index => $value ) { if ( ! is_string( $value ) || ! preg_match( '/^g-[0-9a-f]{7}$/', $value ) ) { continue; } $post = \Elementor\Modules\GlobalClasses\Global_Class_Post::find_by_class_id( $value ); $label = $post ? $post->get_label() : ''; if ( $label ) { $classes[ $index ] = $label; } } return $classes; }

3. After adding the configuration, follow these steps:
- Back up the website and database.
- Open the Default Kit in the primary language and make a small change, then save it.
- Translate and update the Default Kit.
- Run 'Clear Files & Data' or 'Regenerate CSS & Data' in Elementor → Tools.
- Clear all WordPress, server, and browser caches.
- Verify the affected page in the secondary language.

If this solution does not resolve the issue or seems irrelevant due to updates or different configurations, we 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 the problem persists, please open a new support ticket at WPML support forum.

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 15 replies, has 0 voices.

Last updated by marcoB-134 3 weeks ago.

Assisted by: Dražen.

Author Posts
July 9, 2026 at 8:24 am #18148656

marcoB-134

Hello,

We recently added another page (hidden link) to our website using Elementor with an iframe embedded contact form from Zoho.

The integration of the iframe is done through Javascript in order to properly catch multiple tracking/conversion information we need for our marketing activities.

Unfortunately the translated pages all have a damaged layout. It appears that WPML (or another system) has added multiple span elements all across the pages.
hidden link
hidden link
hidden link

If this is done by WPML, why is it done and most of all, what can we do to prevent it from happening again.

Thank you in advance,

Marco

July 10, 2026 at 5:55 am #18150854

Dražen
Supporter

Languages: English (English )

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

Hello Marco,

Thank you for reporting this.

Could you please try creating a new test page in Elementor with the same JavaScript/iframe implementation, making sure to place the code inside Elementor's HTML widget, and then translate the page using the WPML Translation Editor?

After the translation is complete, please check whether the same issue occurs on the translated page.

This will help us determine whether the problem is specific to this page or if it can be reproduced consistently with the current setup.

Please let me know the results, and we'll continue investigating from there.

Regards,
Drazen

July 13, 2026 at 4:50 am #18154130

marcoB-134

Hello Drazen,

Thank you for your prompt reply.

Yes, the script has been placed inside the Elementor's HTML Widget, as you can see from the image.

That being said, it does not seem related to the script.

We have another contact page.
hidden link
hidden link
hidden link

On that contact page, there is no script to load the contact form iframe. The contact form is part of the page.

But still, the layout is distorted on the translated pages.

So it strongly looks like the contact form has no incidence on the distortion of the lay-out. What else could cause this as it only happens on the "contact" and "request-a-demo" pages.

Thank you for your assistance.

Best,

Marco

Elementor_HTML_Widget.png
July 13, 2026 at 7:40 am #18154245

Dražen
Supporter

Hi Marco,

Thank you for the additional information.

I agree that, based on your findings, the iframe script itself does not appear to be the cause. Since the same layout issue also occurs on the Contact page where the form is built directly into the page, it points to something else affecting those translated pages, I do see some CSS rules, so could be that if you have custom CSS and custom theme.

At this point, it's difficult to determine the exact cause without inspecting the website.

Could you please share WordPress administrator access preferably to staging site? That will allow me to compare the original and translated pages, inspect how they are built, and investigate what is causing the layout differences.

Once I have access, I'll take a closer look and update you with my findings.

Thank you!
Drazen

July 14, 2026 at 7:32 am #18156397

Dražen
Supporter

Hello Marco,

Thank you.

I checked the site and noticed that the `elementor_data` custom field had been changed from its default translation preference to Translate, which is not the recommended setting. I changed it back to the default Copy once, but unfortunately that did not resolve the original issue.

1) Have you changed the translation preferences for any other custom fields from their default values? If so, could you let me know which ones?

2) Other than that, I would need to investigate this further. If possible, could you provide a staging site where I can safely perform additional tests? There isn't much more I can do on a production site without risking unintended changes.

If providing a staging site isn't possible, I can instead work from a local copy of your website. If you're comfortable with that, please let me know and I can download a copy and continue the investigation locally.

Kind regards,
Dražen

July 14, 2026 at 8:45 am #18156605

marcoB-134

Hi Drazen,

Thank you for further investigating this.
Any fine-tuning of WPML was done based on feedback we got through the WPML support.

We modified the "Elementor_data" parameter because we were struggling to get the elementor elements, as shown on the attachment, translated. Everything on the page would translate, except for those cards. This occurred across multiple pages,

But, re-reading the previous ticket I created on WPML.org, it was more related to custom XML. So maybe we can flip the switch back to the default setting of that parameter.

There is a staging website with the web-agency that has worked on our website. Unfortunately, there WPML is not installed/configured.

Since there is absolutely nothing secret about our website, I'm fine with your cloning it to a local environment for you.

Best,

Marco

July 14, 2026 at 10:30 am #18156933

Dražen
Supporter

Hello Marco,

Thank you for the clarification.

No problem. I had already reverted the `elementor_data` custom field back to its default translation preference, so we're back to the recommended configuration.

I'm now creating a local copy of your website. Once it's ready, I'll deploy it to my local environment and continue investigating the issue in more depth, where I can safely debug and test different scenarios.

I'll keep you updated as soon as I have any findings.

Kind regards,
Dražen

July 14, 2026 at 11:11 am #18157087

Dražen
Supporter

Hello,

I identified this as a known compatibility issue between WPML and Elementor V4 Atomic Global Classes.

We are working on fix in new versions, as a workaround, please you use next approach:

Add the following entries to your site’s XML via WPML > Settings > Custom XML

<wpml-config>
    <custom-fields>
        <custom-field action="copy">_elementor_global_variables</custom-field>
        <custom-field action="copy">_elementor_global_classes</custom-field>
        <custom-field action="copy">_elementor_global_classes_labels</custom-field>
        <custom-field action="copy">_elementor_global_classes_order</custom-field>
    </custom-fields>
</wpml-config>

Add next workaround to your child theme functions.php

add_filter( 'elementor/atomic-widgets/settings/transformers/classes', 'wpmlsupp13746_resolve_unmapped_global_classes', 20, 1 );

function wpmlsupp13746_resolve_unmapped_global_classes( $classes ) {
	if ( ! is_array( $classes ) || ! class_exists( '\Elementor\Modules\GlobalClasses\Global_Class_Post' ) ) {
		return $classes;
	}

	foreach ( $classes as $index => $value ) {
		if ( ! is_string( $value ) || ! preg_match( '/^g-[0-9a-f]{7}$/', $value ) ) {
			continue;
		}

		$post  = \Elementor\Modules\GlobalClasses\Global_Class_Post::find_by_class_id( $value );
		$label = $post ? $post->get_label() : '';

		if ( $label ) {
			$classes[ $index ] = $label;
		}
	}

	return $classes;
}

After adding the configuration:

1. Back up the website and database.
2. Open the Default Kit in the primary language. (wp-admin/post.php?post=8&action=edit&lang=en)
3. Make a small change, save it.
4. Click to translate and update translation
5. Go to Elementor → Tools and run Clear Files & Data or Regenerate CSS & Data.
6. Clear all WordPress, server and browser caches.
7. Verify the affected page in the secondary language.

Let me know how it goes.

Regards,
Drazen

Kontakt-–-No-Blog-Title-Set-07-14-2026_01_10_PM.jpg
July 14, 2026 at 2:25 pm #18157605

marcoB-134

Hi Drazen,

Thank you for your feedback.

I've added the XML and the code snippet to the functions.php in /wp-content/themes/hotel-spider/

After that, I made a small change through the Elementor editor
"Contact" became "Contact Us"

Once that was published, I went to Elementor > tools and did "Clear Files & Data".
Then I emptied the WP Rocket cache.

Somehow I must still have a cache issue somewhere, as when I load the page, I'm not seeing the changes.

I was surprised that WPML first detected 6 words to translate (WPML_1) and then correctly only detected 1 word (WPML_2).

Any idea what this cache could be?

Best,

Marco

Elementor_Request_a_demo.png
WPML_1.png
WPML_2.png
July 15, 2026 at 5:33 am #18158565

Dražen
Supporter

Hi Marco,

Thank you for the update.

The page itself should not be retranslated. Instead, you need to update the translation of the Elementor Default Kit.

Please check my previous reply, where I included a link that takes you directly to the Default Kit. After making the change, translate the Default Kit, complete the translation, and then check the page again.

Please give that a try and let me know how it goes.

Kind regards,
Dražen

July 15, 2026 at 9:33 am #18159044

marcoB-134

Hi Drazen,

I did the steps you suggested.

From image step1, you can see that I changed the Default Kit.
From image step1, you can see that I updated the translations in each language.

From image step 2, you can see that I cleared the Elementor Cache using the "Clear Files & Data" button.

From image step 3, you can see that I cleared the WP Rocket cache for all languages.

The pages are still distorted.
hidden link
hidden link
hidden link

Not knowing the precise way WordPress, Elementor or WPML works but in the code snippet you have provided to include in the functions.php file, should the add_filter function call not be after the actual declaration of the function? If this was a stupid question, just ignore it and do a facepalm 🙂

Thank you for further help on this topic.

Best,

Marco

code_added.png
Step2.png
Step3.png
Step1.png
July 15, 2026 at 10:13 am #18159253

Dražen
Supporter

Hello Marco,

I just made a small change to the Default Kit and updated the German translation. After doing that, the German page is now displaying correctly on my end.

Could you please check it on your side as well?

Regarding your question about the `add_filter()` call: that's a perfectly valid question. Simplified, in PHP, functions are parsed before execution, so the order of the function declaration and the `add_filter()` call generally doesn't matter. As long as both are loaded during the request, WordPress can safely hook the function.

Please let me know whether the German page now appears correctly for you also.

Kind regards,
Dražen

Kontakt--07-15-2026_12_13_PM.jpg
July 15, 2026 at 11:59 am #18159597

marcoB-134

Thank you Drazen Thank you.

Did I say thank you?
I meant thank you! 🙂

Thank you for helping me through with this issue, despite my lack of know-how of how WordPress works in details.

Best regards,

Marco

July 15, 2026 at 12:13 pm #18159642
marcoB-134

Hi Drazen,

Sorry to re-open this ticket.
I was so happy to see that the lay-out issue was fixed that I did not check the initial problem.

Currently I still see span element across the Elementor HTML element on the following pages:
- hidden link
- hidden link

This prevents the iframe from loading.

In the english version the span element do not appear.

Should I try to reset the "Elementor_data" to its default value and then go through the same change/translation process?

Best,

Marco

New threads created by Dražen and linked to this one are listed below:

https://wpml.org/forums/topic/split-span-element-across-the-elementor-html/

span_this_in_code.png
July 15, 2026 at 12:24 pm #18159687

Dražen
Supporter

Hello,

thanks for getting back.

We limit 1 issue per ticket to keep things clear. This will help other users with similar problems to find solutions when searching the forum.

I have opened a new ticket for you and lets continue there:
- https://wpml.org/forums/topic/split-span-element-across-the-elementor-html/

Regards,

Drazen