design & integration blog

twitter Twitter Feed

Subscribe by Email

Your email:

Current Articles | RSS Feed RSS Feed

Using HubSpot Exported Form Code on Wordpress

 

This article will outline the proper way to install exported form code from HubSpot on Wordpress to avoid getting any spam submission errors. It's easiest to have both your HubSpot portal and your Wordpress site open in separate tabs.

First, create your form in HubSpot by going to Settings > Form Manager > Create New Form. If you're using an existing form you can just hit 'Edit' on the same screen.

Next, hit "Get Form HTML." In the input box you can either put the url of your homepage, such as http://heykenneth.com or a url to a separate thank you page you've already created.

HubSpot Wordpress Form

Hit "Next" and you will be presented with the form code to use on your non-HubSpot website. From here the easiest thing to do is copy and paste all of the code into Notepad or TextEdit if you're on a Mac.

Make note of the following lines of code located between the open and close <script> tags:

HubSpot Wordpress Form

This script, highlighted above, is what HubSpot uses to check for spam when a form is filled out on your website. Next we will cover moving this chunk of code from the exported form html to the header.php file in your Wordpress site.

Once logged into Wordpress:

  1. Click on the "Appearance" tab in the left hand side menu
  2. Select "Editor"
  3. On the right side of the page there will be a long list of core Wordpress files
  4. Look for Header.php

HubSpot Wordpress Form

Wordpress HTML

If you followed the steps above you should now be looking at your website’s HTML

  1. Scroll to the bottom of Header.php and look for the close </head> tag
  2. Paste the chunk HubSpot code right above it
  3. Make sure to include both the open and close script tags <script> … </script>
  4. Hit "Update File"

HubSpot Wordpress Form

The final steps involving taking the remaing code and placing it into a content area on your Wordpress site.

You can either paste the code into a sidebar text widget or directly inline on a content page. If pasting it inline on a content page make sure to be in "HTML" mode.

HubSpot Wordpress Form

If you've completed the steps above, from this point going forward all you will need to do is delete the HubSpot spam check script from your HubSpot exported form code and paste in the html on your Wordpress site as usual.

* Note: Make sure you do not include the script we removed earlier when adding in the form code.

Comments

Currently, there are no comments. Be the first to post one!
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics