Protect your Mailchimp form from bots
In short: To stop spam on a Mailchimp embedded form, run its code through the SpamKill Setup Wizard, delete Mailchimp's mc-validate.js and window.fnames scripts from the result, and paste it on your page. SpamKill checks every signup without a CAPTCHA and real subscribers still reach your audience; afterwards, visitors see Mailchimp's own confirmation page. It takes about 10 minutes.
Bots are signing fake addresses up to your Mailchimp audience. Protect your embedded signup form with SpamKill and real subscribers keep landing in Mailchimp. One limitation to know first: you delete two Mailchimp scripts from the code, and after signing up, visitors see Mailchimp's own confirmation page instead of a message under the form.
- About 10 min
- 6 steps
- Copy and paste one snippet
Last verified on Mailchimp Free (embedded form) with the SpamKill Setup Wizard
What changes, and what doesn't
- Subscribers still arrive in your Mailchimp audience
- Your audience and existing contacts
- Your form's fields and look
- Every signup is checked before it reaches Mailchimp
- Visitors see Mailchimp's confirmation page, in a new tab, instead of a message under the form
- Undo it anytime by putting your old form code back
Before you start
Have these ready so nothing stops you halfway.
- A SpamKill accountNo account yet? Start a free trial.
- A Mailchimp embedded formIn Mailchimp, under Forms, with the form type Embedded form.
- A way to edit your page's HTMLYou'll delete two script tags from the code before you paste it, so use an HTML or code block in your site editor.
Quick setup
For returning users. Each line links to its full step.
- In Mailchimp, open Forms, click Edit on your embedded form, then Continue and Copy Code. Step 1
- In the SpamKill Console, open Setup Wizard, click No to the WordPress question and paste the code. Step 2
- Click Generate Protected Code, check the email field is EMAIL, then click Yes, protect my form. Step 3
- Copy the protected code into a text editor and delete the mc-validate.js script tag and the window.fnames script. Step 4
- Paste the edited code where the Mailchimp code was, publish the page, then click Next. Step 5
- Submit [email protected] and expect an error, then submit a real address and check your audience. Step 6
Copy your embedded form code
Where: MailchimpForms
In Mailchimp, click Forms in the sidebar (1). Click Edit next to your embedded form (2). Click Continue. On Your form is ready!, click Copy Code (3).
You should see: Your form's code on your clipboard. It starts with <div id="mc_embed_shell">.
Paste it into the Setup Wizard
Where: SpamKill ConsoleSetup Wizard
In the SpamKill Console, click Setup Wizard in the sidebar. If your site isn't on WordPress, click No under Is your website developed in WordPress?. Paste the Mailchimp code into the box (1).
You should see: Tips under the box, then Please select the email field input showing EMAIL.
Is this form already live on your site?
Create a new embedded form in Mailchimp and paste its code instead. You can delete the old form once the new one is set up.
Generate the protected code
Where: SpamKill ConsoleSetup Wizard
Click Generate Protected Code. SpamKill asks you to check the email field: it should be EMAIL (1). Click Yes, protect my form (2).
You should see: Replace the existing code with this code on your website, above your protected code.
Delete Mailchimp's two scripts
Copy the protected code and paste it into a text editor. Find the tag <script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js"></script> and delete it. Right after it is a long block starting <script type="text/javascript">(function($) {window.fnames and ending </script>. Delete that whole block too. Leave every other script in place.
You should see: Searching the code for mc-validate and window.fnames finds nothing.
Why delete them?
Mailchimp's validation script sends the form in the background. SpamKill needs the browser to submit it normally, so with the script on the page the signup is lost and nobody sees an error.
Swap the code on your page
Where: Your website editor
Open the page with your Mailchimp form in your website editor. Delete the Mailchimp form code and paste your edited SpamKill code in its place. Save and publish the page. Then click Next in the wizard.
You should see: Your page shows the same signup form as before.
Does your site style the form by field name?
SpamKill renames the email field, and the wizard lists the old and new names. Update any CSS or scripts that point at the old name.
Test it twice
Open your page in a private window. Submit the form with [email protected] (1). Then submit it again with an address you can recognise. Mailchimp opens its confirmation page in a new tab (2).
The first try shows That email address doesn't look right.
The second try appears under Audience as Subscribed, source Embed Form.
Back in the wizard, click Both Tests Passed.
You should see: Your subscription to our list has been confirmed. after the second try.
Your Mailchimp form is protected
- Bots are stopped before they reach Mailchimp.
- Real leads arrive exactly as before, with no extra steps for them.
- Every block is logged in your SpamKill dashboard.
Something not working?
Find what you're seeing.
The form submits, but no contact appears in Mailchimp
One of Mailchimp's scripts is still on the page. Check the live page's code for mc-validate and window.fnames, delete what you find as in step 4, and test again.
A real visitor was told their email doesn't look right
SpamKill checks for missing @ symbols, extra spaces and common typos. The visitor can click Go back to the form, fix the address and send again.
There's no thank-you message under the form
That's expected. Without Mailchimp's script, the confirmation shows on Mailchimp's own page, which opens in a new tab.
Changed your mind? Undo in under a minute
- Open the page in your website editor.
- Delete the SpamKill code and paste your original Mailchimp form code back.
- Save and publish the page. Your form is back to how it was.
Thanks! Glad your form is protected.
Sorry about that. Tell us which step tripped you up and we'll fix the guide.
Stuck? We'll set it up with you.
Free setup help for every plan. Send us a message and we'll walk through your Mailchimp form with you.
Get setup help