Skip to content Skip to sidebar

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

Problem:
You are using Elementor forms on a multilingual website powered by WPML and encountering issues where the form fails to submit on translated pages linked via WPML. Additionally, some global widgets created in Elementor are not rendering properly on these translated pages.
Solution:
To address the form submission issue on translated pages, follow these steps:
1. Add the following code to your functions.php file:

add_action( 'wp_ajax_elementor_pro_forms_send_form', 'wssupp_set_language_ajax_form', 9 );<br />add_action( 'wp_ajax_nopriv_elementor_pro_forms_send_form', 'wssupp_set_language_ajax_form', 9 );<br />function wssupp_set_language_ajax_form(){<br />    $id = $_POST['post_id'];<br />    $post = get_post($id);<br />    $lang = apply_filters( 'wpml_element_language_code', NULL, ['element_id' => $id, 'element_type' => $post->post_type] );<br />    $current_language = apply_filters('wpml_current_language', NULL );<br />    if ( $lang != $current_language ) {<br />        do_action( 'wpml_switch_language', $lang );<br />    }<br />}

This code ensures that the AJAX request for the form submission is processed in the correct language context.

Please note that this solution might be outdated or not applicable to your specific case. If the issue persists, 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. If necessary, please open a new support ticket at WPML support forum for further assistance.

50% of people find this useful.

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

Last updated by oliverF-6 2 months, 2 weeks ago.

Assisted by: Dražen.

Author Posts
May 21, 2025 at 7:03 am #17055259

beco-treat-apsK

Background of the issue:
I am trying to use Elementor forms on a multilingual website powered by WPML. Specifically, I want the same form created with Elementor to function correctly across all language versions of a page, including those linked as translations via WPML. The goal is for the form to validate and submit properly regardless of the page language or translation linkage. Link to a page where the issue can be seen: hidden link

Symptoms:
The form fails to submit on translated pages that are linked to the original English page. The error message displayed is: 'Your submission failed because the form is invalid.' This occurs only when the translated page is connected to the English original via WPML. Additionally, some global widgets created in Elementor are not rendering properly on the frontend of those translated pages.

Questions:
Why does the form fail to submit on translated pages linked via WPML?
Could the issue with global widgets not rendering properly be related to the form submission problem?

May 21, 2025 at 7:24 am #17055325

Dražen
Supporter

Languages: English (English )

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

Hello,

please provide us copy of your website via Duplicator plugin as explained in our docs:

- https://wpml.org/fr/faq/provide-supporters-copy-site/

Please exclude large files if the website is large.

Regards,
Drazen

May 21, 2025 at 10:15 am #17056414

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks for getting back, package is almost 7GB large, please try to exclude your large files / images to keep it small.

If you want you can share admin access to website and I can create new package.

Thanks,
Drazen

May 21, 2025 at 10:37 am #17056512

beco-treat-apsK

I cannot do it like this because i dont got Duplicator Pro.

What i did is to remove the media from the wp-content/uploads, just the years_folder so now is only 500mb aprox. You can use the same link to download.

Hope it works. Let me know if you need admin access to the site.

May 21, 2025 at 11:14 am #17056723

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks.

I managed to deploy the website, and it works just fine.

So I suspect either there is some settings with your server or compatibility with other plugins / must use plugins or similar, since it works just fine on my side, without doing anything.

Video: hidden link

Best I can suggest is creating staging site, and then try to test if issue happens:

- when all plugins disabled, only WPML plugins and Elementor while using parent theme not child
- if issue happens when WPML plugins disabled
- check for debug.log and server error logs for any clues
- maybe try on another server / hosting if possible.

Let me know how it goes and if any clue or reports in error logs.

Regards,
Drazen

May 21, 2025 at 1:18 pm #17057632

beco-treat-apsK

I’m currently working on reproducing the error. As soon as I have something concrete to help us move forward, I’ll get back in touch.

However, I don’t believe this issue is specific to my setup. Here are a couple of links to other discussions that seem to describe the same problem:

https://wpml.org/forums/topic/elementor-form-no-longer-works-in-translated-languages/
https://wordpress.org/support/topic/issue-with-the-form-submission-on-wpml-translated-pages-in-english-and-german/

May 21, 2025 at 1:22 pm #17057713

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks.

It could be, but from my side I can not check or see the issue, so it is a bit difficult to conclude anything else.

If you can share with us staging site where we can safely check issue further, I would be glad to help.

Otherwise you ca try steps I suggested in last reply, and lets see if any clues or if that helps.

Let me know.

Regards,
Drazen

May 21, 2025 at 2:50 pm #17058188

beco-treat-apsK

I was able to reproduce the error on the stage site and i got the credentials for you to check, im also did a video on it.

How can i share the credentials and the video in a private way?

I can confirm that the plugin WPML String is causing the problem.

Thanks

May 22, 2025 at 6:12 am #17059592

Dražen
Supporter

Languages: English (English )

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

Hello,

please share admin access, I have enabled private reply.

Regards,
Drazen

May 22, 2025 at 9:49 am #17060645

Dražen
Supporter

Languages: English (English )

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

Hello,

I checked further and seems the issue is special charters you are using in the form, for example BECOSAN®.

Also you are using Classic editor for translation which is legacy translation editor. I have tested further on localhost and it works fine if you remove the special characters or if you use Advanced translation editor and re-translate page.

Please check and let me know if suggested workaround fix are helpful for you.

Regards,
Drazen

May 22, 2025 at 10:28 am #17060909

beco-treat-apsK

I have removed the special characters from the forms in both the original language (English) and in Dutch, and I can't get it to work.

I confirm that I am using the Classic translation editor, not by choice, it was just activated by default.

My main use case is:
- Create page A with elementor in X language.
- Create page B with elementor in Y language.
- Connect both pages with wpml.
Both pages have layouts or variations and therefore the workflow of translating string to string and keeping the same style that forces us to do wpml by layout does not interest us.

I am literally afraid every time I have to touch any WPML setting or perform any action retroactively, because I have bad experience with WPML breaking all the translated content on several occasions.

I have activated the new advanced translation editor, but I'm not sure if I want to activate "Use also for older translations created with the classic editor..."... I don't know what could happen with my old content...

May 22, 2025 at 10:35 am #17060951

Dražen
Supporter

Languages: English (English )

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

Hello,

if you are doing the translation and edits manually, then you either way should not use WPML editor, as it will overwrite any changes you have done.

You should not mix translation methods, and in this case best would be to use manual method as explained in our docs:

- https://wpml.org/documentation/translating-your-contents/using-different-translation-editors-for-different-pages/

I have done that for you TRY page and remove special charters and it works fine:

- hidden link

Regards,
Drazen

May 22, 2025 at 10:55 am #17061096

beco-treat-apsK

So, does this mean the issue isn’t with WPML, but rather something on my side? Even though everything worked perfectly before, and now the only solution is to manually edit every single page where I have a form — across 11 different languages?

Just to clarify, I’m talking about more than 40-50 pages/lang with forms...

Please don’t get me wrong, Drazen — this is nothing personal. I truly appreciate your time and dedication in trying to reproduce and troubleshoot the issue.

But at this point, what solution is left for me? The problem still seems to be on my end, and I’m stuck with no practical workaround.

May 22, 2025 at 11:11 am #17061186

Dražen
Supporter

Languages: English (English )

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

Hello,

Let me try to clear things, you can translate manually and disable WPML editor, or use WPML editor, you can not mix those methods as you said your workflow is.

So:

1) Manual way I shared, is correct way of updating post/page if you are doing manual adjustment. What you are doing is not recommended nor correct way since it will cause issues.

If you are using WPML editor, which you said you do not wish to translate string by string, then you can not use manual adjustment.

2) If you are using WPML editor, it seems to be an issue with Classic translation editor, and as workaround you can translate it via Advanced translation editor.

3) If you wish to continue to translate via Classic translation editor, I can escalate further to our 2nd tier to check and advise, but we can not guarantee we will be fixing it since it is a legacy translation editor.

Hope this makes it clear, let me know if you wish to proceed with step 3 and I can escalate, otherwise 1 or 2 are ways to go.

Regards,
Drazen

May 22, 2025 at 11:25 am #17061265

beco-treat-apsK

Here you can see a video where I tried to reproduce your steps, but unfortunately, it still doesn’t work on my end: hidden link

I’ve already set the Advanced Translation Editor as the default for all pages on my website.

Could you please explain how to manually translate pages and disable the WPML editor for all of them? Would this create any conflicts or affect other WPML features?

What is the proper way to proceed here?

All I want is for my form to work on translated pages. The only workaround I’ve found so far is to deactivate the “WPML String Translation” plugin, but I’m afraid that could cause serious issues elsewhere on the site.