Where do you put the code for a mailchimp pop up?

Hi there I have a mail chimp Pop Up code but am unsure where to place it, do I put it in the custom CSS somewhere? Becuse when I do it just ad the bottom of all the other custom codes it doesn’t do anything.

Id appreciate some guidance

Hi There,

Thank you for writing in, no don’t paste MailChimp’s generated code on the custom CSS below those are not all styling, you can add the code provided on your page by pasting it on a RAW Content element. But I don’t recommend that, what I recommend is you create a sidebar to hold the MailChimp’s generated code, to do this, please navigate to Appearance > Sidebars get it a name and don’t assign it to any page/post.

Then navigate to Appearance > Widgets there you’ll see the sidebar that you just created. From the left look for the Custom HTML widget and drag that to your mailchimp sidebar then paste your MailChimp’s generated code on that Custom HTML widget and save.

Now every time you want that form to your page, just add a Widget Area element and choose to pull the the mailchimp sidebar.

Hope it helps,

Thank you Friech,
your directions are very easy to understand. I added it on the home page and it worked! I have not been able to find directions as simple as yours on google so im sure others will benifit from this post. I’m wondering however rather than paste a widget on every page is there a way to set it to pop up on all pages easily so it doesn’t matter which page people land on?

Hi Nonie,

Thank you very much, there is a way to place the MailChimp’s generated code sitewide but it require a customization, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here.

First set up a child theme, then add the following code on your child theme’s functions.php file, located at /wp-content/themes/x-child/ directory.

function more_footer_content() { ?>

<!-- Add your code here -->

<?php }

add_action( 'wp_footer', 'more_footer_content', 9999 );

Replace the <!-- Add your code here --> line, with the code provided by MailChimp.


Ive put the code in, but it isn’t working? Anything ive done wrong? I have attached the code, I added the highlighted part in…

Hey Nonie,

I checked your site’s source code and the code is being outputted. That means the code @friech gave works. The problem is with your code. Please reach out to Mailchimp support.


thanks, unfortunately I cant ask for support when I’m on a free plan it looks like. It was working on a widget (how Freich told me) with the same code though, but not when embedded?

Hey Nonie,

Could you please provide the Mailchimp code so that we can test it in our local testing servers? The code should have work both in the widget or when using Friech’s code. By the way, I noticed that you are using W3 Total Cache, please clear your cache first before testing your site again. Your site changes may not be loaded at the moment, which could possibly why the code did not work at the moment. Caching are best enabled when you are finished developing your site.

Please let us know how it goes.

this is the code:

Sorry to be a little dumb but clearing the cache?? is that just clicking on purge caches on my dashboard? Sorry very new to building a website… Thank you so much for all the amazing help!


Yes, you can click on purge cache on your dashboard


Hi Nonie,

I see that you have withdrawn your last post, is the issue has been resolve? Please let us know.


No so the pop up still doesn’t work, i’m wondering is there a way to have the code on the top widget bar in the right hand corner of the screen? I have seen on other sites they do this, and it says eg 15% off and you click it and it opens the pop up? Can you explain how I do this? And I will see if that works

Hi Nonie,

You mean this area?

That is the Header Widget Areas, you can enable that and set how many columns under Theme Options > Header

Then navigate to Appearance > Widgets there you’ll see the 4 (depends how many columns) Widgetized header area. Drag a Custom HTML widget from the left and put your code on that Custom HTML.

Let us know how it goes,

Hello Friech,
I have a similar problem. I also wanted to implement the MailChimp Pop-Up Code to our Website and I tried doing it through raw content and also followed your instructions on using the sidebar. But it still doesnt show up. When I asked the mailchimp Support they said there might be something interfring with the pop up so it doesnt show but they werent sure either. Do you have any ideas of what I need to do in order for it to work?


You can try ConvertPlus plugin instead.

Hope that helps

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.