This thread is resolved. Here is a description of the problem and solution.
Problem: The client reported an issue with the Menu Widget in the footer not displaying correctly in different languages (DE, FR, EN). The problem was traced to a script code added inside an Elementor HTML widget, which is not compatible with WPML's translation tools. Solution: We recommend removing the script from the Elementor HTML widget and instead incorporating it into the website using a PHP snippet. This snippet can then be included via a shortcode or a hook. This approach prevents the script from interfering with WPML's Advanced Translation Editor (ATE), which is designed to handle standard HTML content and not script code. For further guidance on implementing this solution, please refer to our documentation on supporting custom script code.
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. Should you need further assistance, please do not hesitate to open a new support ticket at our 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.
There is a bug in Menu Widget in Footer - first it didnt display in DE and FR and now when i tried to rechoose the Menu in this widget in EN original language FR menu showes up.
Thanks, I have checked, but I would need to temporarily disable some plugins and possibly switch themes to investigate further.
Please let me know if it is possible to create a staging site using the WP Staging plugin. If not, I can take a copy of the website and check it locally instead.
Thanks for your patience. I checked further and found the cause of the issue.
You are adding script code inside an Elementor HTML widget. This is not expected behavior for WPML translation tools, as they are designed to handle standard HTML content. Adding custom script code inside Elementor builder content can cause issues during translation.
When I remove the script from the widget, everything works correctly.
In your case, the best approach would be to move that custom code into a small PHP snippet and include it via a shortcode or hook instead of placing it directly inside the Elementor content.
Thank you for the explanation but this is hard for me to understand..
1. This error appeared once i migrated the website to other wordpress installation.
2. whats menu widget got to do with a HTML script ( please where is this script inserted????)
If this would be the case as you suggest the error occurs - why all was well previously?
Thank you for your message, I understand this can be confusing so let me clarify.
The script is inserted inside an HTML widget in footer template. When WPML Advanced Translation Editor (ATE) processes the content, it parses and restructures HTML. Script inside editable content (like HTML widgets) are not supported and can break the translation structure like it happens with your translated footer template.
ATE is designed to translate text content, not to safely handle JavaScript code inside editable HTML blocks. Because of this, including <script> code inside a template’s HTML widget is not recommended and can lead to broken translation jobs.
It may have worked before if:
- The content was translated using the Classic Translation Editor or manually instead of ATE
- The script was not part of the translated content previously
- The template was structured slightly differently
However, adding JavaScript inside an HTML widget that is processed by ATE is not supported and can cause issues, I know this from cases before and have tested your code on fresh website.
Best practice would be to move the script to the theme or add it via a dedicated plugin for inserting header/footer scripts
This way the script is not part of the translatable content and WPML will not attempt to process it.