[Resolved] span html elements added all accross the translated pages
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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 🙂
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.