WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to use HubSpot Forms API in Wordpress pages?

I have to pass dynamic values to the Hubspot Form.

Thanks in advance

share|improve this question
What are HubSpot forms? When you add some third party plugins/apis in your question, it is better you add a link for the same for reference!! – Maruti Mohanty Nov 12 '13 at 12:11

The easiest way is to use HubSpot's PHP wrappers to get the data you need: https://github.com/HubSpot/haPiHP

Basically the wrappers are just JSON data fetchers, so you can also just take out the code you need from the wrapper source, if you need to.

Create new HubSpot_Forms instance and use e.g. the get_forms() to get the form data. Each form has an array field embeddedCode, which includes a javascript includer snippet, which outputs the form right where you output the field code. Then just use the JavaScript/JQuery method of your choice to populate the fields with your dynamic data.

If you need to populate fields without JavaScript, you'll have to find out the form field attributes, write your own form code and use the submit_form() method to post the data afterwards.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.