Integrating Subscription Forms With WordPress
You can include your ActiveCampaign subscription forms on your WordPress site in two different ways:
Use our official WordPress plugin
Download our plugin from the WordPress plugin directory, or click “Add New” and search for it in your WordPress “Plugins” section.
If you downloaded the plugin, go to your WordPress administrative section and visit the “Plugins” > “Upload” section, and upload the entire Zip folder (that you just downloaded):
On the Plugins page, click “Activate” for the ActiveCampaign plugin:
In the Settings > ActiveCampaign section, paste in your API URL and key and then click “Connect”:
After clicking “Connect” in WordPress, it will display the available forms that are set up in your ActiveCampaign account:
Choose what forms you want to cache locally (in WordPress), configure the specific settings for each form, and then hit “Update.”
To display forms anywhere on your site, use the
Replace “ID” above with the specific form ID.
Here is an example of embedding multiple forms into a single blog post:
To embed a form in the sidebar, add a new “Text” widget and use the same shortcode.
The plugin will detect the form width you have set in ActiveCampaign (under Integration when creating the form). If you want to adjust the width, you must do this in ActiveCampaign, and then reconnect your forms in WordPress:
There are some advanced settings that let you control the following aspects of your subscription form:
- Option to Add subscriber (default behavior) or Sync subscriber (performs edit if the subscriber already exists).
- How the form is submitted: standard page reload, or Ajax.
- Whether or not to use the standard form CSS that ActiveCampaign supplies.
- Whether or not to use your own custom form
Here are some key things to be aware of, regarding the advanced settings:
- If you choose Sync, that requires using Ajax to submit the form because our standard form process handler does not work with Ajax so we included a custom API script with the plugin that does the actual sync (through our API).
- You can also use Sync with your own custom action URL (with or without Ajax), presumably a script that you have set up to perform the add/edit via our API.
- Using the Ajax option requires that jQuery be enabled for your WordPress installation. Here is one way of enabling it.
- When using Ajax there will be a
<div>that appears above the subscription form that contains the result message. You can style this element by targeting this ID:
form_result_messagein your CSS. Example below:
- Any time you use your own custom action URL you will have to use our API to submit the data.
- If you don’t keep the original form CSS, it will simply strip out all CSS that comes with the form. Example screenshot with CSS removed:
Manually copy and paste your form HTML
If you do not wish to use our plugin, you can still easily embed your ActiveCampaign subscription form on your WordPress site.
(Please note: There may be various ways of doing this – we are simply showing one way to accomplish this.)
Under the “Integrate with your site” section of your form settings, copy the “Embeddable HTML” content:
Next, visit the Appearance > Editor section of WordPress:
Choose what template you want to edit. For example, “Sidebar” would be a logical place to add a subscription form:
Paste in the form HTML directly in to the textbox:
Note: you may wish to remove the entire
<style> element (and the content within) as that is known to cause issues with the existing WordPress CSS.
If successful, your subscription form should look something like this:
Subscription form redirects
If you want your WordPress-embedded subscription form to redirect back to your WordPress site after submission, you need to set this up in the ActiveCampaign software.
While editing the subscription form, under “Form settings,” click “subscription confirmation page.”
Next, click “Redirect to URL instead.”
You can then insert your own URL, presumably a WordPress URL that goes right back to the same site!