The Blog of Darren Crawford

Darren Crawford

Darren is a guy who loves marketing technology.

Get Email Variable From URL Into Hidden Field of Office Autopilot Form on Optimize Press 2

I was doing a survey on a page and needed to collect some data but didn’t want the user to enter their email address again.  By default you cannot run PHP code on WordPress posts and pages and need a plugin called Shortcode Exec PHP.  There are others but I found this to be easiest and did not cause any weirdness on the Optimize Press 2 pages.

What we are going to do is change a couple of variables on the HTML form that Ontraport gives us so that we can hide the email address.

Things You’ll Need:


  1. Create your OptimizePress 2 page where the hidden form will reside
  2. Create a shortcode in WordPress by going to TOOLS > Shortcode Exec PHP
  3. Call the shortcode [get_email] and make the 1st line =echo($_GET[email]);
  4. Save the shortcode
  5. Create your Office Autopilot SmartForm as you normally do (see if you need assistance).
  6. Copy the HTML of the form to a text editor
  7. Change the line that looks like this:<input name=”email” type=”email” id=”mr-field-element-12345″ value=”” placeholder=””/>to this:<input name=”email” type=”hidden” id=”mr-field-element-12345″ value=[get_email] placeholder=””/>
  8. In OptimizePress2 Live Editor you will ‘Add An Element’ for HTML
  9. Paste the code into the box and save.
  10. Save the page and visit the page, passing a variable in the url of the page
  11. Now it will be grabbing that email from the URL and passing it in the form.

With this you can collect data on the user without requiring them to enter their email address again.

Posted in


  1. Angela Wright on September 6, 2013 at 6:17 am

    Great advice! Thanks so much 🙂

  2. Jason R. Ayers on September 27, 2013 at 10:36 pm

    Thanks for the awesome step-by-step instructions Darren. This is a very handy way to further segment leads or customers by asking questions as they flow through your sales funnel.

  3. […] take a look at this post on hidden fields in Office Autopilot forms. That had the ‘how-to’ part for doing hidden forms […]

  4. Philipe on March 13, 2015 at 6:47 pm

    That is really, awesome! Tks Darren!

Leave a Comment