Connecting Mailchimp to your WordPress Site

Disclosure: As an Amazon Associate I earn from qualifying purchases. Some of the links in this post are "affiliate links" to Amazon and/or WordPress related services and products. This means if you click on the link and purchase the item, I will receive a small commission. There is no charge or increase of price for you. For more information, take a look at my affiliate & "Recommends" information page.

Mailchimp offers a feature where it connects to your website to serve a popup, or persistent form, to attract subscribers right on your site. No additional landing pages required!

This feature is available only to Self-Hosted and Paid .COM blog sites that allows custom themes and plugin installation. There is a Mailchimp pop-up subscriber form feature for their FREE blog sites, but it’s not this feature.

For self-hosted, and paid, WordPress blogs, this Mailchimp Connect feature requires a bit of effort, but is an effective way of collecting email addresses from website visitors and building that all important email list.

But First

Before you gather the code from Mailchimp, decide how you are going to put their code (a long piece of JavaScript) into your WordPress website.

Are you going to:

  • A) Modify your theme’s header.php file
  • B) Modify your child theme’s header.php file
  • C) Install a plugin that can put the code in for you
  • D) Use GeneratePress Pro’s Elements feature

Any option, save for Option A, is a viable option.

Never. Ever. Ever. Ever. modify your theme’s files. Any of them. You will lose any changes you make if you ever have to update your theme. Use a child theme or plugin.

– Any Decent WordPress Developer, Ever

Child Themes are a wonderful, rich, feature of WordPress theming, but they are not going to be discussed here because that’s an entirely different blog post for an entirely different Wednesday. (Drop me a comment below if you would like to see a walk through of making a child theme!)

GeneratePress affiliate (badge)
The Fiery Well, LLC is an affiliate of GeneratePress.

For the purpose of this tutorial we’re going to discuss the plugin options. The GeneratePress Pro is a plugin that works on top of the theme, and includes the wonderful Element… element.

Don’t have GeneratePress Pro? No worries!

I cover using a free plugin, too, so you can keep using the still amazing free version of GeneratePress.


Now that we know how we’re going to put the code into our site, let’s go get it!

Connecting Mailchimp

Step One: Connected Sites

At the top right of the screen, while logged in to your Mailchimp account, click on your account name and you’ll see a dropdown box with “Connected Sites” appear. Click on that and let’s get started.

Step Two: Choosing Your Builder

Scroll down and look for the WordPress option under “Website Builder.”

Screenshot of Mailchimp Add URL section

Step Three: Entering Your Details

You’ll be taken to a page where you can enter your website address (Enter site URL) and select the audience with which to connect the popup form.

It’s a good idea to set up a welcome email for your Popup subscribers, too (we’ll cover this in a later post.)

For now, back to the process:

Click “Get Code” and you’ll be given a box with a long, long, piece of code that needs to live on your website.

Adding the Code to Your WordPress Site

Option A) With GeneratePress Pro Elements

We’re going to create a new “hook” element, so navigate to Appearance > Elements in your WordPress Admin dashboard. Add a New Element.

Element Settings

You can name it what you want, just like a blog Post. I named mine “Mailchimp Connect” so I don’t lose it in my long list of elements (I love this feature of the Pro theme and use it a lot.)

In the big empty field is where you will paste the code from Mailchimp.

Scroll down the page until you see “Settings” and in the Hook options, choose “wp_head.” This will make sure the code is where it needs to be, at the beginning of the page’s code, or in the “header.”

Element Display Rules

This section let’s us control where in the website the code will work, if we’re going to exclude any pages, and control what users the popup will show up to.

For my site, I want the popup everywhere, so I chose “Entire Site” with no exclusions.

However, I only want to show users that are “Logged Out.” This ensures that signed in members of The Fiery Well do not get bombarded with the popup every time they are on the site, and that I don’t see it when I’m working on the website.

Save the element.

Option B) With a Free snippet / code injector plugin

There are a few “code snippet” and “code injection” plugins available in the WordPress Plugin Directory, and I have used and recommend (at the time of this writing) the options below.

Both of these options are a simple install from your WordPress admin dashboard. Navigate to Plugins > Add New and search for them in the search box. From there it’s a one-click install to get them installed and start working with them.

Head, Footer and Post Injections

This option gives you a lot of granular control, such as what pages it will appear on, much like the GeneratePress Pro Elements. The interface is a bit overwhelming, so if you like an even more streamlined option take a look at:

Insert Headers and Footers

This is, by far, the simplest of the options. You’ll navigate to Settings > Insert Headers and Footers and past the code in the first box

Past your code into the first box, “Scripts in Header,” click save and you’re done.

Return to Mailchimp

Check Connection

After adding the code to your site, return to the page on the Mailchimp site where you copied the code.

Click on the “Check Connection” button and wait for the chimp rock-on hand (pictured). Once you see this, you are golden.

Click “Return To Your Site” and Mailchimp will walk you through creating the popup form.

You can choose where it pops up on the page (from the side, in the middle, etc.), add an image to highlight the popup and be sure to add a few blurbs about why your site visitor should join.

Keep your choices in alignment with your brand, make it attractive for visitors to join, and watch the subscribers roll in!

Love it? Pin it!

That’s a Wrap

Not the simplest or easiest thing to do, but if you take your time and follow the prompts that Mailchimp offers, you can do this. I believe in you. And if you don’t want to do this, you can always hire me to do it for you.

More to come…

Be on the lookout for more posts about Mailchimp, such as their Automation and building that first Thank You email for your pop up subscribers.

If you have more questions, or suggestions for posts, drop them in the comments below and I’ll get to work on them.

I’m working on a series of technical posts aimed at witches in my new #witchesforwebsites series.

I’ll take you through grabbing the domain name you want, choosing hosting, and getting a WordPress site installed. From there we’ll work on adding functionality to start selling your products or booking tarot readings. It’s going to be technical, it’s going to be guided from the perspective of a fellow witch, and it’s going to be fun.

Be sure to join the mailing list to know when these posts are live!


Join the Circle

Stay up to date on Tarot, #websitesforwitches and more with The Fiery Well, LLC. Unsubscribe at any time.

Leave a Comment