How it Works

The Import Users From CSV plugin allows you to create new users and update existing users by importing a simple CSV file.

This Paid Memberships Pro Add On extends the functionality that plugin, allowing you to automatically assign membership levels to users at import, update subscription information, or migrate and continue existing subscriptions simply by adding a few columns to your CSV file.

Import Template | Assign Membership Levels | Maintaining Active Subscriptions | Column Headings | Billing Information

This plugin requires Import Users From CSV to be installed and activated.

Installation

  1. Install and activate Import Users from CSV.
  2. Install and activate the Import Users from CSV Integration Add On.
  3. Upload the pmpro-import-users-from-csv directory to the /wp-content/plugins/ directory of your site.
  4. Activate the plugin through the ‘Plugins’ menu in WordPress.

CSV Import Template

Download the template below to begin formatting your data for import.
Sample Import Users From CSV Template (.zip)

Screenshot to show how to get to "Import From CSV" on WordPress

Once you’ve got your template set up, just import it like you normally would with Import Users From CSV. Be sure to save the CSV as MS-DOS format.

  1. Go to Users > Import from CSV in the WordPress dashboard.
  2. Configure your options. If you would like to update existing users, make sure the “Users update” checkbox is checked.
  3. Click the Import button.
  4. If you have existing subscriptions hitting an old IPN or Webhook URL, you may need to use custom code like this to redirect that traffic to the equivalent PMPro URL.

Note: If you have any unused column headers after filling out the template, delete them or your import will fail.

We recommend testing the import with a portion of your data or with testing data until you can confirm your CSV is properly formatted. Once you can trust your spreadsheet format and confirm that the correct and complete data is imported, try a smaller segment of your actual data. Repeat imports can cause orphaned data or accidentally cancel subscriptions. If you are updating existing users, it may be best to run SQL queries directly in your database by following the guide here.


Assigning Membership Levels

The only field required to give a user a membership level is membership_id, but it’s best to fill out as many fields as possible.

The membership level ID can be found on the Memberships > Membership Levels page in the WordPress Dashboard.

Most of this information can also easily be obtained from existing memberships by using the Export to CSV feature in Memberships > Members List in the WordPress Dashboard.

Note: The membership level ID needs to be a numerical value, for example – “3”.


Maintaining Active Subscriptions

If you want to continue or update an existing subscription, you must fill out the membership_subscription_transaction_id and membership_gateway fields.

The Gateway and Subscription Transaction ID can both be found on the Memberships > Orders page under the Gateway and Transaction IDs columns respectively.

If you want to update an existing subscription, you must enter the updated billing details as well.

Screenshot of Billing Details

Please note that if you are migrating from s2member you must redirect the IPN using the instructions in this guide.


Column Headings

Below is an explanation of the column headings and what they mean:

Column HeadingField Description
membership_id*Membership Level ID of the user’s membership level. This can be found by going to Memberships > Membership Levels int he WordPress Dashboard.
membership_code_idDiscount Code ID (if one was used). This can be found by going to Memberships > Discount Codes in the WordPress Dashboard.
membership_initial_paymentThe initial payment for the user’s membership level. This is usually set by the Initial Payment section on the Edit Membership Level page.
membership_billing_amountThe recurring billing amount for the user’s membership level. This is usually set by the Billing Payment section on the Edit Membership Level page.
membership_cycle_numberThe number of billing cycles for the user’s membership level. This is usually set by the Billing Payment section on the Edit Membership Level page.
membership_cycle_periodThe billing cycle period. Possible values are “Day”, “Week”, “Month”, and “Year” (without the quotes). This is usually set by the Billing Payment section on the Edit Membership Level page.
membership_billing_limitThe billing cycle limit for the user’s membership level.
membership_trial_amountThe trial amount for the user’s membership level.
membership_trial_limitThe number of cycles the trial should last for the user’s membership level.
membership_statusThe status of the user’s membership. Possible values: active, inactive
membership_startdateThe member’s start date. (formatted as YYYY-MM-DD)
membership_enddateThe member’s end date. (formatted as YYYY-MM-DD)
membership_timestampDate to use for the timestamp of the order we generate on import. Generally the last payment date for the member. (formatted as YYYY-MM-DD)
membership_subscription_transaction_id**The Subscription Transaction ID. This is required to continue or update an existing subscription and can be found on the Memberships > Orders page in the WordPress Dashboard.
membership_gateway**The Payment Gateway for the user’s recurring subscription. Possible values are “check”, “stripe”, “paypalstandard”, “paypalexpress”, “paypal”(for website payments pro), “payflowpro”, “authorizenet”, and “braintree” (without the quotes).
membership_payment_transaction_idThe Payment Transaction ID. This can be found on the Memberships > Orders page in the WordPress Dashboard. This is the transaction ID created by the payment gateway. This field can be omitted on import, but is useful as a reference for a user’s last payment made between the site and your gateway. For import, you can optionally set this to the last single transaction ID received as part of the users’s subscription.
membership_affiliate_idThe Affiliate ID associated with the user’s order. This is only used if an affiliate tracking system is installed.
pmpro_stripe_customerid(For Stripe customers only) The Customer ID. This is the same as membership_subscription_transaction_id above.

*required to assign membership levels
**required to update recurring subscription


Billing Information Import

Since Paid Memberships Pro stores users’ billing information in user meta, you can also populate billing information by adding these columns:

Column HeadingField Description
pmpro_bfirstnameFirst Name
pmpro_blastnameLast Name
pmpro_baddress1Address Line 1
pmpro_baddress2Address Line 2
pmpro_bcityCity
pmpro_bstateState
pmpro_bzipcodePostal Code
pmpro_bcountryCountry – this should be one of the country codes found in includes/countries.php
pmpro_bphonePhone
pmpro_bemailEmail Address
pmpro_CardTypeCard Type – possible values are “Visa”, “Mastercard”, “American Express”, and “Discover” (without the quotes).
pmpro_AccountNumberCard Number – 16 digit card number in the format XXXX-XXXX-XXXX-1234
pmpro_ExpirationMonthExpiration Month – 2 digit expiration month of card(January = 01, February = 02, etc.)
pmpro_ExpirationYearExpiration Year – 4 digit expiration year of card