MailChimp is a platform that helps you collect emails and send notices and newsletters to your site visitors. It’s a useful tool and mostly free to use with sufficient features for the average website owner. One of those features is MailChimp’s popup form builder which is easy to use and pretty elegant from a design standpoint. So I was surprised to receive an email today from a client asking me to help add the MailChimp popup script to his website. I thought this was going to be a simple matter of grabbing the code from his MailChimp account and popping it into the page he wanted to use to trigger the popup. Unfortunately, there is a conflict with the way MailChimp calls up jquery and the way WordPress manages it in its core scripting.

After a couple searches on Google, I found out that a popular solution is to place a copy of jquery.js in the root domain for the website. This “fix” didn’t work for my client’s website. Also, I was concerned that putting jquery.js in the root domain would unnecessarily clutter the root and, worse, locally store a jquery file that would not receive potentially necessary updates, unlike the version on MailChimp’s own servers.

What did work was easier and safer. Basically, I helped WordPress find MailChimp’s javascript by adding a link to the script in my client’s header.php file above the ending head tag so that it looks like this:

 <script type="text/javascript" src="https://s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" ></script>
 <?php wp_head(); ?>
</head>

This option allows you to use and manage the popup form right from your MailChimp account. It also lets you embed MailChimp’s script just on the pages or posts you want to use to trigger the opt-in popup. If you’re having a similar issue trying to get MailChimp’s popup to work on your WordPress site, try embedding the link above your ending head tag, clear your browser’s cookies, and refresh the page. Your popup form should now work on your WordPress site.

*Updated 6/5/2017: I changed the location of the javascript from http to https to avoid issues with unsecured content on sites using SSL/TLS.

Pin It on Pinterest

Share This