Misha Rudrastyh

Misha Rudrastyh

WordPress Developer

Mailchimp Synchronization for User Roles and WooCommerce Memberships

Automatically subscribes/unsubscribes users to your MailChimp lists, depending on User Role (or Membership Plan).

Get the plugin
Each WordPress user role can be synchronized with the different MailChimp list. Group Interests are supported as well.Plugin checks if WooCommerce Memberships is installed on your website and suggests you to go to the plan edit page to configure the synchronization.Just copy your MailChimp API key to start the synchronization. Please notice that your API key is protected - it is not fully visible on the settings page.If WooCommerce Memberships is installed on your website, you can configure MailChimp synchronization just in plan settings.
  • Each WordPress User Role can be synchronized with the specific Mailchimp list.
  • Custom user roles are supported.
  • Unsubscribe users from specific lists after registration.
  • Safety of your MailChimp API (nobody can see it in admin area).
  • WooCommerce Memberships Integration
  • Each status of each WooCommerce Memberships plan can be synchronized with the specific Mailchimp list!
  • Custom membership plan statuses (added via action hook) are supported.
  • Interest groups support.

How it works — Real Website Example

The website which inspired me to create this plugin had 3 Lists in its MailChimp account — Free Newsletter, Premium Subscribers and Lapsed Premium Subscribers. The key features were:

  1. When someone buys premium membership, my plugin checks if this email address is already subscribed to Free Newsletter, if yes — it will be unsubscribed from Free Newsletter and only after that subscribed to Premium Subscribers.
  2. When user membership is expired the plugin will remove the user from Premium Subscribers list and subscribe to Lapsed Premium Subscribers — so the user could receive the emails with offers, which will suggest him to renew his subscription.
  3. When administrators change user membership — the MailChimp lists will be updated automatically.
  4. If user was removed in admin area section, his emails will be removed from MailChimp lists as well.


After purchasing my plugin you will receive it by email. In WordPress dashboard go to Plugins > Add New and click the Upload Plugin button on this page.

When you activate the plugin you will see the message:

MailChimp API key is required

Click on the link in this message or just go to Settings > MailChimp Sync (Settings tab).

Just copy your MailChimp API key to start the synchronization. Please notice that your API key is protected - it is not fully visible on the settings page.

That’s all. To confugire the plugin — go to the Roles tab or to a specific membership plan edit page.

Each WordPress user role can be synchronized with the different MailChimp list. Group Interests are supported as well.

If you click Assign Interests button, the popup with all list interests will appear.

Groups of Interest in MailChimp
  • Just choose the interests you want to add to a user with a specific role.
  • If you want none of interests to be selected, click the blue Assign Interests button anyway!
  • Otherwise my code won’t make any operations with interests for a specific list.
If WooCommerce Memberships is installed on your website, you can configure MailChimp synchronization just in plan settings.

Unsubscribe new users from the specific list

This can be implemented easily with mch_sync_unsubscribe_new_users_when_register filter. All you need is to pass MailcChimp list ID to the function. Well, this is how to do it step-by-step:

  1. First of all you should know the MailChimp list ID to unsubscribe new users from. To find it in MailChimp account go to Lists then click on the list title, and choose in menu Settings > List name and defaults.
    Go to Lists > Settings > List name and defaults to obtain a list ID. Do not use list ID from the screenshot - it is fake.
  2. The second thing — insert to you current theme functions.php file the following piece of code:
    function rudr_unsubscribe_first(){
    	return '7fda9761a'; // your Mailchimp list ID should be passed here, of course '7fda9761a' is not real list ID

    Currently only one list is supported, but in future I plan to add the array support.

Debug messaging, error.log

When working with MailChimp I think it is not very good idea to show the error messages to users, and we couldn’t ignore them as well.

In the plugin directory you can find the error.log file – all error messages and subscribe events are stored there. Example:

[2016-05-29T06:49:15+00:00] Error: Schema describes object, NULL found instead; merge_fields
[2016-05-29T06:50:53+00:00] misha@rudrastyh.com; subscribed; 7fda9761a
[2016-05-29T06:50:53+00:00] misha@rudrastyh.com; unsubscribed; 5fda9761a

The first error is appeared when MailChimp list has required fields, but these fields was not passed to the function, for example, when user didn’t provide his First Name and Last Name.

The file is protected, so you access it only via FTP/File Manager.

Money Back Guarantee!

If for some reason the plugin wouldn’t work on your website – please let me help you to fix it, if I can't, I will simply return your money.

2.2 – Oct 16, 2016

  • Added: Multiple Memberships support.

2.0 – July 8, 2016

  • Added: Interest groups support.
  • Improved: Plugin usability when API key is not specified.

1.0 – May 31, 2016

  • Release date.

Comments 14

  • Hi,

    Great plugin! I wonder if it is possible to let members/subscribers join different interest groups on the MailChimp-list based on their Zip Code?

    As I see it, it is only their first and last name info that are imported to MailChimp, but it could be great if it was possible to let them assign groups based on the Zip Codes they enter at Checkout, so I could be able to make local campaigns.



    • Hi Daniel,

      thank you for the interesting idea. I should think how to implement it the best way. Just check plugin updates from time to time.

  • Hi Mischa I have installed and activated the plugin, and entered my API key. However after changing a user’s role, I do not see the lists in Mailchimp update. Does the plugin run on some kind of timer or should the changes be instantaneous? Thanks

    • Hi Caleb,
      yes, sometimes it takes a little time to make update in MailChimp lists, I’m not sure why – I think it is some type of MailChimp API cache etc.

      Please, let me know if it works now.

      • Hi Misha, it’s been 24 hours and still no changes to the memberships? What triggers the changes? Is there a way to manually trigger a refresh?

        • Hi,
          I think I understand what you mean.

          Do you mean bulk changes for existing users?

          • Hi Misha, yes, I have implemented your plugin but still have not seen any lists in Mailchimp updated. I tried to “trigger” an update by changing a user’s role, but even after 24 hours nothing has changed. Please advise how we can troubleshoot.

          • Please, contact me by email, I will help.

  • RIchard TandohJuly 3, 2016 at 22:07

    +1 for groups support, for the same reason as Jason. I will keep my eye out for its addition. Thanks.

  • It appears that your plugin is unable to add customers to different groups within a list. Is this possible? I do not want to have to work with multiple lists in Mailchimp, but would rather assign customers according to their membership to a specific interest group – child group within my list

    • MishaAuthorJune 23, 2016 at 03:06

      Hi Jason,
      thank you for this idea – I will try to implement it as soon as possible. After that you can update the plugin via WordPress admin area.

      • Thank you Misha. Having only one list means I can keep my Mailchimp costs down as users are counted as separate subscribers for each list they appear on. A single list also allows people to unsubscribe easily.

        I look forward to the update.!

Leave comment

Please, enter a comment
Please, enter a name
Incorrect email

Get the plugin


Get this plugin with free updates and unlimited expert WP support.
* for unlimited websites
© 2016 Misha Rudrastyh
Developed on with