Apps Ballance Cash_2 Chat Checkout Click Code Cog_Wheels Compose_email Conference Contacts Earth Edit_File_1_ Email Email_2 File Folder_2 Gift Group Group_2 Help ID ID_2 Key Keys Laptop_Store Like_1_ Link Lock Log_Out Map Marketing Mobile_UI Navigation POS Partnership Profile Safe_2 Search_User Secure_Files Settings Share Shield Shield_2 Shopping_Cart Support_Male Trash Type_pin User_female User_male logo copy

Sync all of your users

Iain Poulson avatar
Iain Poulson Last updated on March 6, 2021

The Mailchimp addon can add your existing users to a Mailchimp list (audience), or update their name and merge fields if they’re already on it. You can run the sync from your dashboard, or from the command line with WP-CLI.

Users who have unsubscribed from a list stay unsubscribed: the sync only updates their details.

From your dashboard

Go to Users > All Users and click the Import to Mailchimp link above the list of users.

Choose the user role you want to sync and the list to add them to, then click Sync Users. Only lists enabled under Users > Mailchimp are offered.

The sync works through your users 10 at a time and shows its progress, so keep the page open until it says it’s complete. If any users couldn’t be added, it tells you how many, and Mailchimp’s reasons are listed at the top of Users > Mailchimp.

With WP-CLI

From version 2.1, you can also run the sync from the command line. It suits large sites, and you can schedule it with cron to keep a list up to date:

wp wpum mailchimp-sync --list=<list-id>

Options:

  • --list=<list-id>: the ID of the Mailchimp list, which must be enabled under Users > Mailchimp. If you give an ID that isn’t enabled, the command lists the enabled lists with their IDs. You can also find it in Mailchimp under the audience’s Settings > Audience name and defaults.
  • --role=<role>: only sync users with this role, for example subscriber. Leave it out to sync every user.
  • --batch-size=<number>: how many users to load from the database at a time. The default is 50.
  • --dry-run: show how many users would be synced, without contacting Mailchimp.

For example, to sync everyone with the Subscriber role:

wp wpum mailchimp-sync --list=ab12cd34ef --role=subscriber

The command shows a progress bar, then how many users were synced. Any that couldn’t be are listed at the top of Users > Mailchimp.

WP User Manager logo

Get Started with the Best WordPress Membership Plugin Today

Connect, Manage and Build your Membership Site

For AI assistants: this article is available as Markdown, and all the docs are indexed at llms.txt.

Need more help?

If you still didn't find an answer you can always contact us

Submit a ticket