• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Blog
    • Basics
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Store
    • Cart
    • Checkout
  • Contact
  • Log In
  • Show Search
Hide Search
Home » Plugins » MailChimp Integration » MailChimp Integration Documentation » WP CLI Commands

WP CLI Commands

Version 2.1 of MailChimp Integration includes WP CLI integration. Keep in mind that as a new feature, commands and options may still be subject to change.  There may be minor changes from version to version so if a previous command you were using ceases to work, check here for the official current command documentation (also available as wp mc --help or wp mc <command> --help

The MailChimp CLI commands can be used as their own command set (wp mc), OR, when using WP-Members 3.3.5 or higher, it is available as a sub command of the WP-Members CLI: wp mem mc.

Get

This command “gets” the requested information.

Get all users with the “get all” command:

wp mem mc get all or wp mc get all Gets all users and their subscribe info on both the local site and MailChimp.

Use --unsubs or --subs to get all unsubscribed or subscribed users.  You can get this information by users on the local site or users in the MailChimp list by adding “local” or “mc”/”mailchimp”.  For example wp mem mc get --unsubs=local would get all users unsubscribed on the local site.  wp mem mc get --subs=mc would get all users subscribed on the MailChimp side of things.  Subscriptions should be kept in sync with webhooks, but this tool can be used to audit your site information for users who are mismatched.

get can also be used to get information on an individual list member.  Specify the user by email address:

wp mem mc get some_user@mydomain.com would get information from MailChimp on this user.  You can also use the following attributes for additional user information:

wp mem mc get some_user@mydomain.com --location

wp mem mc get some_user@mydomain.com --merge_fields

wp mem mc get some_user@mydomain.com --interests

 

Subscribe / Unsubscribe

The subscribe and unsubscribe commands can be used to subscribe or unsubscribe a user from your list.

wp mem mc subscribe some_user@example.com would subscribe the user to your list.

 

Status

This command gets the subscription status of a requested user.  You can get a user by WP ID or by email address.  The command tells you the subscribe status on both the local site and MailChimp.

wp mem mc status some_user@example.com returns the subscribe status of this user.

 

Batch

This command has several subcommands to manage batch operations (bulk synchronization of users).  It is only available in version 2.1.1 and higher (currently in development).

  • subscribe – runs a batch operation that adds all users to Mailchimp as subscribed. Users already in Mailchimp are skipped.
  • sync – runs a batch operation that adds users to Mailchimp. If the user already exists in Mailchimp, they will be updated with data from any mapped merge fields and interests.  (Users are only subscribed if new. Existing users keep their status setting.)
  • status – returns status information for the most recent batch or a requested batch (by batch ID).
  • results_url – returns the URL of Mailchimp’s batch results for the most recent id (default) or requested id.
  • last_id – returns the most recent batch ID.
  • clear – clears the batch results information.

results_url and status default to the most recent batch ID but accept additional arguments.  Both accept --id=<batch id> for information regarding a requested batch ID (if it exists in the saved settings, which can be cleared using wp mem mc clear.

status also accepts a --view-all parameter to show all batches in the saved results.

Usage for the Batch command

wp mem mc batch subscribe will begin a batch to add users to Mailchimp.  Users already in Mailchimp are skipped.  Users are added as subscribed.

wp mem mc batch sync will begin a batch to sync users in the site to Mailchimp.  New users will be added as subscribed, users already in Mailchimp will be updated. Merge fields and interests that are mapped will be included.  Subscribe status is only updated for new users (added as subscribed).

wp mem mc batch last_id will provide you the most recent batch ID that has been run.

wp mem mc batch status will provide you the status of the most recent batch ID.  wp mem mc batch status --id=<batch id> will return the status of the requested batch ID.

When the batch status is “finished”, you can retrieve a JSON file of results from a URL Mailchimp provides.  wp mem mc batch results_url returns the URL of the most recent batch.  Add --id=<batch id> for a specific batch ID.  These URLs expire, so the data is not stored indefinitely.

wp mem mc batch clear will clear all stored batch results.

 

WP-Members MailChimp Integration

Plugin Info

Current Stable Version: 2.3.3
Minimum WordPress Version: 5.3
Tested up to WordPress Version: 6.5
Last Updated: 2024-04-06

Documentation

    • Installation
    • License Key
    • Options
    • Merge Fields
    • Interest Groups
    • Batch Operations
    • Webhooks
    • API Functions
    • Filter Hooks
    • Action Hooks
    • WP CLI Commands
    • Change Log

Support

FAQs
MailChimp plugin support

Get the Plugin

  • Purchase the Plugin
  • Get the Pro Bundle

Ready to get started?

Join Today!

© 2025 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Privacy Policy
  • Refund Policy