How to Sync WordPress Users with Mailchimp

1. Installation

Plugin installation is pretty similar to any WordPress plugin installation:

  1. Download the ZIP archive of the plugin after the purchase.
  2. Open your WordPress dashboard and go to Plugins > Add new.
  3. Upload the plugin and activate it.
  4. You will need to provide your 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 the settings. First of all, you can now configure rules on 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 the “Newsletter” list with tag “Offers” and also to the “Privacy Policy changes” list.

3. Sync additional fields

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

Long story short, you can send any user’s metadata, such as first names, last names, and maybe birthday dates (depending on your website) to Mailchimp. 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 can be found in this support article.

4. How does it work, exactly?

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

TriggerAction
A user was registered.

A user was added manually in the admin area.

A user was registered in the custom code using wp_insert_user(), wp_create_user() or register_new_user() functions.
The user’s email will be subscribed to Mailchimp audiences connected to the user’s roles. All the appropriate merge tags will be added as well.
A user was registered with the “Double Opt-In” option turned on.If users never existed in these specific audiences to which we are going to subscribe, 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.
A user role was changed in the admin area or in the code with the wp_update_user() function.The user’s email will be unsubscribed from audiences connected to his previous role and subscribed to an audience connected to the new role. If a new user role isn’t connected to any audience, the user will be unsubscribed.
Both the user role and user email were changed at the same timeThe old user’s email will be removed from Mailchimp audiences connected to his old role, and the new user’s email will be subscribed to the list connected to the new role.
User was removedThe user’s email will be unsubscribed from all the audiences connected to the user’s role.

5. Manually resync all users to Mailchimp

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 us 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 two-way synchronization:

  • allows you 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. An example of plugin configuration for a specific membership plan is in 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 the “Premium Subscribers” list with two tags. If their “Premium” membership plan has expired, they are going to be unsubscribed from the “Premium Subscribers” list and subscribed to the “Expired follow-ups” list.