# Pass variables to form embedded in WordPress page

**URL:** https://forum.mautic.org/t/pass-variables-to-form-embedded-in-wordpress-page/8318
**Category:** Product Support
**Created:** [April 24, 2017, 7:36pm UTC](https://forum.mautic.org/t/pass-variables-to-form-embedded-in-wordpress-page/8318 "2017-04-24T19:36:13Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)
#### Post date: [April 24, 2017, 7:36pm UTC](https://forum.mautic.org/t/pass-variables-to-form-embedded-in-wordpress-page/8318/1 "2017-04-24T19:36:13Z")

</div>

Hi,  
  
  
  
when I am embedding a form in a Mautic landing page, I am able to pass form values via URL parameter (e.g. [emailadresse=info@test.de](mailto:emailadresse=info@test.de)) which is then pre-filled into the form.  
  
  
  
When I am embedding the same form into a WordPress page (either manual or automatic copy) this does not work.  
  
  
  
Any idea on…  
  
…why it does not work?  
  
…how to pre-fill values from URL parameter?  
  
  
  
Thank you,  
  
  
  
Peter

---

<div class="post-metadata">

### Author: ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)
#### Post date: [April 24, 2017, 7:36pm UTC](https://forum.mautic.org/t/pass-variables-to-form-embedded-in-wordpress-page/8318/2 "2017-04-24T19:36:13Z")

</div>

Hi,

when I am embedding a form in a Mautic landing page, I am able to pass form values via URL parameter (e.g. [emailadresse=info@test.de](mailto:emailadresse=info@test.de)) which is then pre-filled into the form.

When I am embedding the same form into a WordPress page (either manual or automatic copy) this does not work.

Any idea on…  
…why it does not work?  
…how to pre-fill values from URL parameter?

Thank you,

Peter

---

<div class="post-metadata">

### Author: ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)
#### Post date: [April 25, 2017, 4:30am UTC](https://forum.mautic.org/t/pass-variables-to-form-embedded-in-wordpress-page/8318/3 "2017-04-25T04:30:35Z")

</div>

Yes, I pasted the CSS, the HTML and the JavaScript code. The form itself works fine but the URL parameters are not inserted into the fields.

---

<div class="post-metadata">

### Author: ![denispavliha](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@denispavliha](https://forum.mautic.org/u/denispavliha)
#### Post date: [April 25, 2017, 4:34am UTC](https://forum.mautic.org/t/pass-variables-to-form-embedded-in-wordpress-page/8318/4 "2017-04-25T04:34:14Z")

</div>

Use hidden fields and fill them using JS?

---

<div class="post-metadata">

### Author: ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)
#### Post date: [April 25, 2017, 5:14am UTC](https://forum.mautic.org/t/pass-variables-to-form-embedded-in-wordpress-page/8318/5 "2017-04-25T05:14:58Z")

</div>

> [@22569:@denispavliha](#):
>
> Use hidden fields and fill them using JS?

Is there an easy way to do this? I am not really familiar with JS.

---

<div class="post-metadata">

### Author: ![denispavliha](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@denispavliha](https://forum.mautic.org/u/denispavliha)
#### Post date: [April 25, 2017, 5:18am UTC](https://forum.mautic.org/t/pass-variables-to-form-embedded-in-wordpress-page/8318/6 "2017-04-25T05:18:17Z")

</div>

$(document).ready(function() { $(’#idOfFieldInput’).val(“yourvalue”); });

This is using jQuery. And I am posting this from my phone, so believe me it’s not tested code 🙂 But you should get an idea, right?

Best,  
D.

---

<div class="post-metadata">

### Author: ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)
#### Post date: [April 26, 2017, 6:07am UTC](https://forum.mautic.org/t/pass-variables-to-form-embedded-in-wordpress-page/8318/7 "2017-04-26T06:07:45Z")

</div>

I can’t get it to work and I am not sure how to debug it.

For the current campaign, I am going back to a Mautic landing page. But I will keep testing with WordPress.

---

<div class="post-metadata">

### Author: ![knishikawa](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@knishikawa](https://forum.mautic.org/u/knishikawa)
#### Post date: [September 18, 2017, 3:42pm UTC](https://forum.mautic.org/t/pass-variables-to-form-embedded-in-wordpress-page/8318/8 "2017-09-18T15:42:22Z")

</div>

I had the same problem in a membership plugin and i solved via php.

1. open plugin editor and i found the file that creates the form
2. add at the top of that file these lines:

`<?php
$email = isset($_GET["email"]) ? $_GET["email"] : "";
$first_name = isset($_GET["first_name"]) ? $_GET["first_name"] : "";
?>`

email and first\_name are the value used by plugin in wordpress form… you can change them by your needs
