Home›Support›English Support›[Resolved] I need help understanding why some Elementor buttons correctly switch their URL to the translated en...
[Resolved] I need help understanding why some Elementor buttons correctly switch their URL to the translated en...
This thread is resolved. Here is a description of the problem and solution.
Problem: You are trying to translate buttons in Elementor that link to a custom post type or other pages, using post IDs for linking. While some buttons correctly update to the translated URL, others do not, and occasionally the URL field is missing in the translation editor. Solution: Firstly, ensure that system fields like
_elementor_data
are not modified as they should remain in their default state to avoid issues. For buttons, using type="link" in Elementor should automatically direct internal links to the translated versions of the posts/pages. If these fields are set correctly, they won't appear in the Translation Editor because they are automatically configured to point to the correct translation. If the URL field does not appear in the Translation Editor, you can locate the URLs by following the steps outlined here: https://wpml.org/faq/how-to-translate-links/#translating-external-links Additionally, you can find the necessary XML for any widget automatically through this link: https://wpml.org/documentation/support/multilingual-tools/registering-custom-elementor-widgets-for-translation/
If this solution does not resolve your issue or seems outdated, 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 problems persist, please open a new support ticket with us 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 am trying to translate buttons created in Elementor that link to a custom post type ('Casos de Éxito') or other pages. All posts in that CPT have translations completed. The buttons are set to link using the post ID (not a manually typed URL). Link to a page where the issue can be seen: hidden link
Symptoms:
Some buttons are correctly updated to the English URL, but others remain linked to the Spanish URL. In some cases, the URL field does not appear at all in the translation editor, so I cannot fix it manually.
Questions:
Why do some Elementor buttons correctly switch their URL to the translated entry while others do not?
Why does the URL field not appear in the translation editor for some buttons?
I’ve thoroughly debugged the issue and found that the child theme was causing the problem. It seems to contain some custom code or XML that interferes with the translation. When switching to the parent Elementor theme, the button links appear correctly for translation.
Thanks for your update. Just to clarify: in the child theme we added a wpml-config.xml file with the following code:
<?xml version="1.0"?>
<wpml-config>
<custom-fields>
<custom-field action="translate">_elementor_data</custom-field>
<custom-field action="copy">_elementor_edit_mode</custom-field>
<custom-field action="copy">_elementor_version</custom-field>
<custom-field action="copy">_elementor_template_type</custom-field>
</custom-fields>
<!-- Button widget: expose the link field for translation -->
<widget name="button">
<fields>
<field key="link" type="Link">
<translation>translate</translation>
</field>
</fields>
</widget>
</elementor-widgets>
</wpml-config>
We added this file because:
We needed the HTML widget field to be copied to translations (so a custom <div> for tsparticles in homepage is preserved across languages).
We also wanted the Elementor Button link field to appear in the Translation Editor, since some buttons were not updating automatically to the translated URL and the field wasn’t visible to adjust manually.
Could you please confirm if this configuration conflicts with the way WPML handles Elementor links, or if we need to adjust/remove specific parts of it?
If I remove this XML configuration as you suggest, how can I make sure the HTML widget (with the <div id="tsparticles-hero"> used for the particle animation) is preserved across translations?
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
Hi Ellie,
System fields such as _elementor_data should in general not be changed, as they can cause issues if translated or set differently as they are by default. I’m attaching a screenshot to show you how these are by default.
Thanks for clarifying. I understand now that _elementor_data should not be modified, and that using type="link" makes the links switch automatically but not appear in the Translation Editor. I’ve already removed the custom XML I had added.
The only reason I added it before was because the HTML widget with my <div id="tsparticles-hero"> (particle animation) wasn’t being copied into the English version. Could you please confirm the recommended way to ensure that this HTML widget is preserved across languages without editing _elementor_data? That’s the only part I still need to solve.
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
Can you tell me where the tsparticles-hero comes from? Is it part of a code package, a post, or maybe a template?
I noticed that the English page actually has it, but for some reason, it doesn’t render on the frontend. I also don’t see any errors in the browser console.
Thank you for checking this in detail. I’ve just realized the issue was that my enqueue code in functions.php was limited to the Spanish page ID only (419). The English page has a different ID (4120), so the script wasn’t being loaded there.
I’ve updated the code to include both IDs, and now the particles are showing correctly on both versions.
Really appreciate your time and help in debugging this!