How it Works
Import Users From CSV is a WordPress plugin that allows you to create new users and update existing users by importing a simple CSV file. This Add On extends the functionality of the Import Users From CSV 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.
- Install and activate Import Users from CSV.
- Install and activate the Import Users from CSV Integration Add On.
- Upload the
pmpro-import-users-from-csvdirectory to the
/wp-content/plugins/directory of your site.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
How to Import Users to Your Membership Site
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.
- Go to Users > “Import from CSV” in the WordPress admin.
- Configure your options.
- If you would like to update existing users, make sure the “Users update” checkbox is checked.
- If you suspect your CSV has duplicate records for existing members, check the box to “Skip existing members”. This tells the import tool to skip over members with a current membership level and is particularly helpful for large CSV files that include duplicates.
- Click the Import button.
- 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.
CSV Import Template
Download the template below to begin formatting your data for import.
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.
Please note that if you are migrating from s2member you must redirect the IPN using the instructions in this guide.
Import File Data Column (Column Headings)
Below is an explanation of the column headings and what they mean. While most fields are optional, you must import the
user_email field to match and update existing user information via import.
- user_login: The unique username for this user.
- user_email: The unique email address for this user.
- user_pass: The password to set for this user.
- first_name: The user’s first name.
- last_name: The user’s last name.
- display_name: The desired name that displays for this user when reference on the frontend or backend of the membership site.
- role: The desired user role for this user. Leave blank to set to site default for newly imported users. We highly recommend keeping the role set to “subscriber”.
- 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_id: Discount Code ID (if one was used). This can be found by going to Memberships > Discount Codes in the WordPress Dashboard.
- membership_initial_payment: The 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_amount: The 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_number: The 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_period: The 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_limit: The billing cycle limit for the user’s membership level.
- membership_trial_amount: The trial amount for the user’s membership level.
- membership_trial_limit: The number of cycles the trial should last for the user’s membership level.
- membership_status: The status of the user’s membership. Possible values: active, inactive
- membership_startdate: The member’s start date. (formatted as YYYY-MM-DD)
- membership_enddate: The member’s end date. (formatted as YYYY-MM-DD) *If the membership level is set up on an automatically recurring subscription no end date should be added.
- membership_timestamp: Date 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_id: The 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 is useful as a reference for a user’s last payment made between the site and your gateway. For import, you set this to the last single transaction ID received as part of the users’s subscription.
If you are using the Stripe gateway, this field is required for importing new users with an existing Stripe subscription. If this is not done, Stripe will not be able to get the Customer object successfully as that is queried using the payment transaction ID.
- membership_affiliate_id: The Affiliate ID associated with the user’s order. This is only used if an affiliate tracking system is installed.
- pmpro_stripe_customerid: If you are using the Stripe gateway, include this column in your import. This field 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 Heading||Field Description|
|pmpro_baddress1||Address Line 1|
|pmpro_baddress2||Address Line 2|
|pmpro_bcountry||Country – this should be one of the country codes found in includes/countries.php|
|pmpro_CardType||Card Type – possible values are “Visa”, “Mastercard”, “American Express”, and “Discover” (without the quotes).|
|pmpro_AccountNumber||Card Number – 16 digit card number in the format XXXX-XXXX-XXXX-1234|
|pmpro_ExpirationMonth||Expiration Month – 2 digit expiration month of card(January = 01, February = 02, etc.)|
|pmpro_ExpirationYear||Expiration Year – 4 digit expiration year of card|
Import Custom Fields
- You can import any custom field that you have added to your WordPress site using Paid Memberships Pro user field features like Register Helper.
- You can also import custom fields that are used in other. ways on your site, such as customer data for WooCommerce.
To import custom fields, add additional columns to your import file where the column name is the unique
meta_key used for your user field.
Action and Filter Hooks
apply_filters( 'pmproiufcsv_cancel_prev_sub_on_import', false );
This is a Plus Add On.
Plus Add Ons are included in all Plus or higher premium membership plans.