This post covers how to export your Members List to CSV. We’ll cover the default columns included in the export, as well as a method to add additional user data to the file.


Access the Members List Export

The “Export to CSV” feature of Paid Memberships Pro is located on the Memberships > Members List admin page. Here you will see your full Members List, which can be filtered based on several features, including Membership Level, Status, or via search. The exported CSV file is based on the active filter in the current view. If you would like to add additional data to this admin page or allow for more detailed filtering, see:


Default Fields Included in the Members List Export

The basic CSV export will include the fields below, if they are available for the user. Not every field below is captured for every user and fields for some users may be blank in the export. This depends on your site settings and active payment gateway.

Data from the WordPress users Table

  • id: The User’s ID; ID
  • username: The user’s username; user_login
  • firstname: The user’s first name; first_name
  • lastname: The user’s last name; last_name
  • email: The user’s email address; user_email
  • joined: The date the user registered in the WordPress site (user_registered)

Data from the WordPress usermeta Table

  • billing firstname: The user’s billing first name; pmpro_bfirstname
  • billing lastname: The user’s billing last name; pmpro_blastname
  • address1: The first address line of the user’s billing address;pmpro_baddress1
  • address2: The second address line of the user’s billing address; pmpro_baddress2
  • city: The user’s billing address city; pmpro_bcity
  • state: The user’s billing address state; pmpro_bstate
  • zipcode: The user’s billing address zip code; pmpro_bzipcode
  • country: The user’s billing address country; pmpro_bcountry
  • phone: The user’s billing address phone; pmpro_bphone

Data from the pmpro_memberships_users Table

  • membership: The user’s membership level name; membership
  • initial payment: The amount the user’s paid at checkout for their currently active level; initial_payment
  • fee: The amount the user is paying per subscription term; billing_amount
  • term: The term of the user’s subscription (day, week, month, year); cycle_period
  • expires: The date the user’s membership level expires; enddate

Data from the pmpro_discount_codes Table

  • discount_code_id: If membership was purchased using a discount code, the ID of the code; id
  • discount_code: If membership was purchased using a discount code, the code’s value; code

Adding Additional Data to the Export

There are a few methods to add data to your CSV export.

The easiest method applies to fields that are created via the Register Helper Add On. The code that adds your additional fields will simply need to be updated with attribute memberslistcsv => true. See detailed information on adding fields via Register Helper here.

If you need to add fields that were not created via Register Helper, you will need a custom function that uses the hook: pmpro_members_list_csv_extra_columns . For example, the code recipe below demonstrates how to add fields from the wp_users or wp_usermeta tables as well as fields added via BuddyPress. There may be other custom tables you need to pull in data from, in which case you’d need to access the user information in another way (dependent on the plugin you are trying to interact with).


The Code Recipe

This code recipe requires a PMPro Plus Account or higher.

View Membership Options


Comments (13)

The export is great. Is there a way to import it? We had an issue with the WP database and had to restore to an earlier period. We have an export csv of the member list in pmpro and want to re-0import the membership status from the csv? Is it possible?

Is there a way to programatically export the user lists? Say I have three new signups, can we set a job to run to export only these new users to the CSV to a path on the server? The idea is to automate the export for accounts that are new or undergo a change, in info or membership level, for integration with another system which can take action based on the changes.

I’m wondering,

Is there a way to view the users whose login have expired and also export to CSV?

or is there a plugin I’d have to install?

> login have expired

WP and PMPro don’t expire “logins”, but maybe you mean memberships. You can export a list of expired members by going to Memberships -> Members List, then choosing “Expired Members” or “Old Members” (old members includes members who cancelled vs just expired) and then clicking the export to CSV button.

Hope this helps.

Tried to export cancelled members in order to send them a targeted email and all the fields were blank except “joined.” Is this related to the new GDPR requirements or is this an error? If on purpose, is there a way around it? Thank you.

I replied to your comment on another post, but basically we didn’t change the members list export. Something else might be going on. If you are trying to export a deleted/forgotten user then a lot of data will be missing, and that is intentional. You probably don’t want to email those users.

Hi!
I have a problem: i’ve a list of 3k members and when i export CSV from Orders list, i cannot export all list but only the first thousand row.

Can you help me to solve this problem? I want to export the entire list of orders in a unique sheet.

Thanks

Hello

Thanks for this code, it works seamlessly.
I have a question regarding column formatting for numbers. Our members get a custom 5 digit membership number with preceding zeros which are formatted like this 00001, 00002, 00502, etc etc. When exporting the list to CSV we are losing the preceding zeros. Is there a way around this?

Leave a Reply

Your email address will not be published. Required fields are marked *