Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/lpecanha/mautic-cf7/archive/refs/heads/main.zipFree WordPress plugin that integrates Contact Form 7 with Mautic.
Every time a CF7 form is submitted, this plugin replicates the data — along with UTM parameters, visitor IP and the Mautic form ID — to the /form/submit endpoint of your Mautic instance. No external APIs, no license keys, no signup.
Why use it
- Zero cost. No monthly fees, no submission limits.
- No Elementor dependency. Works with Contact Form 7, which is lightweight and free.
- Per-form configuration. Each CF7 form can point to a different Mautic instance / Form ID.
- Native UTM support. The parameters
utm_source,utm_medium,utm_campaign,utm_contentandutm_termare forwarded automatically when they exist as form fields. - Doesn't block the visitor. If Mautic is slow or unreachable, the CF7 form still completes the submission flow normally.
Requirements
| Component | Minimum version |
|---|---|
| WordPress | 5.0 |
| PHP | 7.3 |
| Contact Form 7 | 5.0 |
| Mautic | 7.1 |
Installation
Option 1 — Download the ZIP
- Download this repository as a ZIP: Code → Download ZIP.
- Rename the file to
mautic-cf7.zip. - In WordPress, go to Plugins → Add New → Upload Plugin and select the ZIP.
- Activate the plugin.
Option 2 — Via FTP / SSH
cd wp-content/plugins
git clone https://github.com/LPecanha/mautic-cf7.git
Then activate it under Plugins → Installed Plugins.
Configuration
1. Create the form in Mautic
In Mautic, go to Components → Forms → New and create a form (Campaign Form or Standalone). Write down:
- The ID of the form (visible in the URL:
/s/forms/view/42→ ID is42). - The alias of every field (under the Fields tab, click a field → the alias is the technical name, e.g.
email,first_name).
2. Build the matching form in Contact Form 7
The name of each CF7 tag must exactly match the Mautic alias. Example:
<label> First name
[text* first_name] </label>
<label> E-mail
[email* email] </label>
<label> Phone
[tel phone] </label>
[submit "Send"]
⚠️ If the alias in Mautic is
first_name, the CF7 tag must be[text* first_name]— not[text* name].
3. Connect the form to Mautic
In the CF7 form editor, click the Mautic tab (added by this plugin):
| Field | What to fill in |
|---|---|
| Mautic Form URL | Base URL of your Mautic instance (e.g. https://mautic.yourcompany.com). Do not include /s/ at the end. |
| Mautic Form ID | Numeric ID of the Mautic form (e.g. 42). |
Save the form. That's it — every submission from this CF7 form will land in Mautic.
Forwarding UTMs
If you run campaigns with UTM parameters (Google Ads, Facebook, email marketing, etc.), add hidden fields to your CF7 form and populate them via JavaScript from the URL query string:
[hidden utm_source]
[hidden utm_medium]
[hidden utm_campaign]
[hidden utm_content]
[hidden utm_term]
The parameters are automatically appended to the Mautic call whenever they're present.
To populate hidden fields from the URL, you can use the Contact Form 7 Dynamic Text Extension plugin or a small JS snippet.
How it works under the hood
- You activate the plugin → it adds a Mautic panel to the CF7 editor (via the
wpcf7_editor_panelsfilter). - You fill in URL + Form ID → both are saved as
post_metaon the CF7 form (_mautic_cf7_urland_mautic_cf7_form_id). - A visitor submits the form → CF7 validates it and fires the
wpcf7_before_send_mailaction. - The plugin listens for that action, reads the fields via
WPCF7_Submission::get_posted_data()and sends aPOSTrequest to:
{mautic_url}/form/submit?formId={id}&utm_source=...&utm_medium=...
Request body:
[
'mauticform' => [
'formId' => '42',
'first_name' => 'John',
'email' => 'john@example.com',
// ... remaining fields
]
]
The Client-Ip and X-Forwarded-For headers are sent with the visitor's IP so Mautic can preserve geolocation tracking.
Troubleshooting
Submissions are not showing up in Mautic.
- Check that the Form ID really corresponds to the Mautic form you're looking at.
- Confirm the Mautic URL is correct and reachable from the public internet (it can't be
localhostif WordPress lives on a different server). - Open
{mautic_url}/form/submit?formId=Xdirectly in your browser — it should return the Mautic form page. If you get a 404, the form doesn't exist or is unpublished.
Submissions arrive but fields are empty.
- The
nameof each CF7 tag must match the alias of the Mautic field — not the visible "label". - Watch out for uppercase/lowercase and hyphens vs. underscores.
The CF7 form spins for a while before showing the success message.
- This means Mautic is slow or unreachable. Check the network latency between WordPress and Mautic.
- By default the call to Mautic is synchronous (waits for a response). If you want to decouple it, edit
includes/integrations/Mautic_CF7_Integration.phpand add'blocking' => falseand'timeout' => 4to the arguments ofwp_remote_post().
Message "Mautic CF7 requires Contact Form 7 installed and active".
- Install and activate Contact Form 7. The plugin only works with it.
Security
- The admin panel uses a
nonce(mautic_cf7_save_settings) to protect against CSRF. - All admin outputs are escaped (
esc_attr,esc_html__). - Inputs are sanitized with
esc_url_rawandsanitize_text_fieldbeforeupdate_post_meta. - The plugin does not store submission data locally — it just forwards it to Mautic.
License
Author
Built by Lucas Peçanha.
Issues, feature requests and PRs are welcome: github.com/LPecanha/mautic-cf7/issues.