How to Sync WordPress Users with Mailchimp

1. Installation

Plugin installation is pretty much similar to any WordPress plugin installation you know.

  1. Download ZIP-archive of the plugin after the purchase.
  2. Open your WordPress dashboard and please go to Plugins > Add new.
  3. Upload the plugin and activate it.
  4. You will need to provide Mailchimp API key in plugin settings Settings > Mailchimp Sync.
how to get Mailchimp API key
Do not worry, it is super-easy, just click the link in Settings, sign in to your Mailchimp account and copy the API key from the just opened page.

2. Configure audiences and tags

Once your API key is configured, more options will appear in settings. First of all you can now configure rules how you would like your WordPress users to be synchronised with Mailchimp.

You can set one or multiple rules for every default or custom WordPress role. For example below I set multiple rules for a custom “Customer” role.

Decide what user roles you would like to connect with specific Mailchimp audiences and tags
I decided to subscribe all website customers to “Newsletter” list with tag “Offers” and also to “Privacy Policy changes” list.

3. Sync additional fields

Additional fields are also called *|MERGE|* tags. In the previous version of this plugin they can only be configured with a hook (code snippet) but now friendly interface is available.

The long store short you can send any users metadata like first names, last names, maybe birthday dates (depends on your website) to Mailchimp. And as a result, this data will appear in your audience contacts and you can do segmentation using it. For example to send specific emails only to contacts whose age is above 20.

As you can see the plugin asks to provide “User field” – it is how the field is stored on your website and the name of a specific *|MERGE|* tag in Mailchimp.

More details about syncing WordPress user meta fields with Mailchimp *|MERGE|* tags you can find in this support article.

4. How it works, exactly?

I think the best way to describe how the plugin works is with this table:

User was registered.

User was added manually in admin area.

User was registered in the custom code, using wp_insert_user(), wp_create_user() or register_new_user() functions.
User email will be subscribed to Mailchimp audiences connected to his user roles. All the appropriate tags will be added as well.
User was registered with “Double Opt In” option turned on.If users never existed in these specific audiences we are going to subscribe them to, they will receive a confirmation email then.
Personal information (First name, Last name, Email etc) was updated by the user or by the administrator.

Personal information was updated in the code via wp_update_user() function.
The information will be updated in Mailchimp automatically.
User role was changed in admin area or in the code with wp_update_user() function.User email will be unsubscribed from audiences connected to his previous role and subscribed to an audience, connected to the new role. If new user role isn’t connected to any audience, user just will be unsubscribed.
Both user role and user email were changed at the same timeOld user email will be removed from Mailchimp audiences, connected to his old role and new user email will be subscribed to the list connected to the new role.
User was removedEmail will be unsubscribed from all the audiences connected to users’s role.

5. Manual Resync

I completely understand that sometimes you may install the plugin on an existing website with hundreds or maybe thousands of users. That’s why I added the feature that allows to manually sync WordPress users with Mailchimp audiences depending on their roles.

Manual resync WordPress users with Mailchimp audiences

Syncing Back from Mailchimp to WordPress

The plugin also supports the two-way syncronisation:

  • allows to update user profile information on your WordPress website when a specific user profile has been updated in Mailchimp,
  • or to delete site users when they unsubscribe from a Mailchimp audience.

In order to make this functionality possible you need to install a free add-on which is available in your Member’s area after the plugin purchase. The add-on also provides additional options in Settings > Mailchimp Sync:

Sync Mailchimp audience updates to WordPress
You can decide whether you would like to only sync profile information updates or to only delete users when they unsubscribe from a list or both.

Mailchimp for WooCommerce Memberships

The plugin is also ready to be used with your WooCommerce Memberships plans. Example of plugin configuration for a specific membership plan is on the screenshot below.

Every plan status can be synced with a specific audience (list ID).

sync WooCommerce memberships with specific Mailchimp audiences
If users have an active “Premium” membership plan, they will be subscribed to “Premium Subscribers” list with two tags. If their “Premium” membership plan is expired, they are going to be unsubscribed from “Premium Subscribers” list and subscribed to “Expired follow ups”.