Quantcast
Channel: Code Recipe Posts for Extending Your Membership Site
Viewing all articles
Browse latest Browse all 326

Exporting Your Members List: Default Data and Adding New Columns

$
0
0

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 these fields:

  • id
  • username
  • firstname
  • lastname
  • email
  • billing firstname
  • billing lastname
  • address1

  • address2
  • city
  • state
  • zipcode
  • country
  • phone
  • membership
  • initial payment

  • fee
  • term
  • discount_code_id
  • discount_code
  • joined
  • expires


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. 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 Core Account or higher.

View Membership Options


Viewing all articles
Browse latest Browse all 326

Trending Articles