Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 1 reply, has 0 voices.

Last updated by Waqas Bin Hasan 3 days, 22 hours ago.

Assisted by: Waqas Bin Hasan.

Author Posts
August 27, 2025 at 9:31 pm #17353004

Josh Warren-White

Background of the issue:
I am trying to make sure a custom-built form in a page with a custom template that posts the submitted data to the expected page. The form is located at hidden link and upon submission, it should send the form data to this page - hidden link.

Symptoms:
The $_POST variable always returns empty. However, when I turn off the WPML plugin, the form behaves as expected. This was a recent issue as I had been testing this custom form on the staging site within the last couple of weeks with no issues and nothing was changed.

Questions:
Why does the $_POST variable return empty when WPML is active?
What changes in WPML could affect form data submission?

August 28, 2025 at 1:06 pm #17355177

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support.

Please note that support for custom coding is out of scope of this forum, however, I analyzed the form on your given URL and I see the "action" parameter of form is set to hidden link (notice the ?lang=en at end of the URL).

This is causing a redirect (302) which is receiving form data but upon redirection, not forwarding it to /your-guide/ destination.

However, if you remove that ?lang=en from the URL, there's no redirect and form data reaches the destination.

Since you're default language is English, you shouldn't add a language parameter to it. However, the same can create a pitfall for translated languages (i.e. Spanish).

On the other hand, I see that you perhaps are hardcoding this language parameter in your code, because on Spanish form the action refers to hidden link (notice ?lang=es twice, one seems hard coded while other is being added by WPML in the switcher). I may be wrong but the action URL for translated one is surely wrong.

I'll recommend using "Different languages in directories" for Language URL Format in WPML -> Languages for a better approach to deal with such scenarios.

IMPORTANT: Please take full backup of your website and database beforehand. 

It is highly advised to try this on a staging/dev site first, so your live website isn't compromised.

Regards.

Screenshot 2025-08-28 175832.jpg
Screenshot 2025-08-28 175748.jpg
Screenshot 2025-08-28 175648.jpg
Screenshot 2025-08-28 175631.jpg
Screenshot 2025-08-28 175543.jpg
Screenshot 2025-08-28 175451.jpg
Screenshot 2025-08-28 175340.jpg