Build A Membership Site TodayLearn More »Pricing & Plans »

MemberPress Importer

The MemberPress Importer allows you to import Users, Products, Subscriptions, Transactions, Coupons and Rules into MemberPress from a CSV file.

MemberPress Importer can be downloaded and installed here:

MemberPress Add-Ons

Installing MemberPress Importer

The MemberPress Importer installs just like any other plugin ... but MemberPress must be installed before it will do anything.

MemberPress Importer will add an additional menu item to MemberPress here:

import_menu

Creating your CSV file

CSV stands for "comma separated values" ... this is a very common format used by Spreadsheets. You can create a standard spreadsheet in Excel, Numbers, Open Office, or Google Spreadsheet ... and then export a CSV file from your spreadsheet.

The CSV file must be in Windows Format.  We are working on a fix so this won't matter, but for now, only Windows CSV format will work.

All of the importers require their own unique data items to be present in the CSV file ... but they will all follow a couple of conventions:

  1. Each CSV file must have a header row (first row of the file) which contains the name of the field ... everything in the column under the first row will be flagged as being a value for the field defined in the header.
  2. The columns of the CSV file don't need to be in any set order ... the data fields are determined not by order but by the header name.

Importing your CSV file

Screen Shot 2013-02-04 at 3.19.14 PM

Only one CSV file can be imported at a time ... and many of our CSV file types depend on data already being imported into MemberPress ... so there's a definite order you should import your files in. Here's a quick breakdown of what data depend on elements from other data.

ImporterDependencies

In other words:

  • Users & Products CSV files have no dependencies
  • Coupons & Rules CSV files depend on Products already being imported
  • Transactions & Subscriptions CSV files depend on both the Users & Products data already being imported -- and optionally coupons that have already been imported. Also transactions & subscriptions may also rely on the id of a payment method setup in MemberPress -> Options -> Payments.

WARNING: Make sure that the data you are importing hasn't already been imported because, other than the users CSV file, the CSV file will be imported, duplicating the data already present.

Here's a breakdown of what each of these CSV files should look like:

 

Users CSV Format

Required Columns:

  • username -- This is the User's user_login / username field. This is just a small text
  • email -- This is the User's user_email. This must be a properly formatted email or the record could fail

Optional Columns:

  • role -- This is the WordPress user role. Can be 'subscriber', 'contributor', 'author', 'editor' or 'administrator'. Defaults to 'subscriber'.
  • password -- Allows you to set the users password. This password will be encrypted/hashed and stored in the database.
  • gen_password -- When set, the Importer will generate a new random password for each member being imported. Use this one carefully as it will override the password field above if set, and will override any existing members' passwords.
  • first_name -- First name of the user. Can be any small string of text. Defaults to blank.
  • last_name -- Last name of the user. Can be any small string of text. Defaults to blank.
  • website -- Website for the user. Can be any small string of text. Defaults to blank.
  • address1 -- Address Line 1 for user. Can be any small string of text. Defaults to blank.
  • address2 -- Address Line 2 for user. Can be any small string of text. Defaults to blank.
  • city-- City for user. Can be any small string of text. Defaults to blank.
  • state -- State for the user. Can be any small string of text. Defaults to blank.
  • zip -- Zip Code for the user. Can be any valid zip code string. Defaults to blank.
  • country -- Country for the user. Can be any small string of text. Defaults to blank.
  • *usermeta* -- Use the slugs for the Custom User Information Fields you created in the options here to import custom meta for your members.

If the username of the user already exists in the system then the user record will be updated with the information in the CSV file associated with the username.

 

Products CSV Format

Required Columns:

  • name -- Name of the product. Can be any small string of text.
  • price -- Price of the product. Can be any number in decimal format without a currency symbol -- for example: 5.99 ...
  • period -- Number of weeks, months or years. Can be any valid whole number if the period_type='months' or period_type='weeks' but anything else, this can only be 1.
  • period_type -- This is the period type. Can be 'weeks', 'months', 'years' or 'lifetime'.

Optional Columns:

  • trial -- Sets whether or not the product has a trial period. Can be 1 for true or 0 for false. Defaults to 0.
  • trial_days -- Number of days the trial will last. Can be any whole number. Defaults to 0.
  • trial_amount -- The amount that will be charged to start the trial. Can be any number in decimal format without a currency symbol -- for example: 5.99 ...
  • group_id -- The group_id (which should already exist in MemberPress) of the group that the product should belong to. Must be the ID of a valid memberpress group. Defaults to 0 (which indicates no group).

 

Transactions CSV Format

Required Columns:

  • username or email-- The username or email address of the user that should be associated with the transaction. Must belong to an already existing user in the database.
  • product_id -- The ID of the product that this transaction is for. Must be the ID of an already existing product in the database.  The id can be found in the url when editing the product.  For example the product id in this url: http://awesomesite.com/wp-admin/post.php?post=10&action=edit is 10.
  • amount -- Price of the product. Can be any number in decimal format without a currency symbol -- for example: 5.99 ...

Optional Columns:

  • sub_num -- The subscription number that references the subscription. This sub_num must reference an already existing subscription in the database. Defaults to blank.
  • payment_method -- The unique id of the payment method .. this can be found in the payments tab of MemberPress options. Defaults to 'manual'. If you're importing Free members you can also set this to 'free'.
  • coupon_code -- The coupon code of the coupon applied to this transaction. Must reference a coupon that already exists in the database. Defaults to blank.
  • send_welcome -- Controls whether the user will receive a welcome email along with this newly created transaction. Can either be 1 for true or 0 for false. Defaults to 0.
  • trans_num -- The gateway's transaction number. Can be any small string of text. If blank, a random id will be generated.
  • status -- The status of the transaction. Can either be 'pending', 'complete' or 'refunded'. Defaults to 'complete'.
  • created_at -- The date this transaction was created. Must be in the format "YYYY-MM-DD hh:mm:ss". Defaults to current date.
  • expires_at -- The expiration date of the transaction ... when a transaction expires it must be renewed by the user for them to continue to have access. Must be in the format "YYYY-MM-DD hh:mm:ss". Defaults to null.

 

Subscriptions CSV Format

You should only import subscriptions if you are migrating automated recurring profiles (for PayPal Express Checkout, Authorize.Net ARB or Stripe) from another system. These are only necessary for tracking automated subscriptions.

Required Columns:

  • username -- The username of the user that should be associated with the transaction. Must belong to an already existing user in the database.
  • product_id -- The ID of the product that this subscription is for. Must be the ID of an already existing product in the database.
  • sub_num or subscr_id -- The subscription number that references the subscription.
  • amount -- Price of the product. Can be any number in decimal format without a currency symbol -- for example: 5.99 ...
  • period -- Number of weeks, months or years. Can be any valid whole number if the period_type='months' or period_type='weeks' but anything else, this can only be 1.
  • period_type -- This is the period type. Can be 'weeks', 'months', 'years' or 'lifetime'.
  • payment_method -- The unique id of the payment method .. this can be found in the payments tab of MemberPress options. This must reference a payment method that points to the account where the subscription profile for sub_num was created in.

Optional Columns:

  • trial -- Sets whether or not the product has a trial period. Can be 1 for true or 0 for false. Defaults to 0.
  • trial_days -- Number of days the trial will last. Can be any whole number. Defaults to 0.
  • trial_amount -- The amount that will be charged to start the trial. Can be any number in decimal format without a currency symbol -- for example: 5.99 ...
  • status -- The status of the subscription. Can either be 'pending', 'active' or 'cancelled'. Defaults to 'active'.
  • started_at or created_at -- The date that the subscription started at. Must be in the format "YYYY-MM-DD hh:mm:ss". Defaults to the current time.
  • coupon_code -- The coupon code of the coupon applied to this transaction. Must reference a coupon that already exists in the database. Defaults to blank.

 

Coupons CSV Format

Required Columns:

  • type -- The discount type of the coupon. Can either be 'dollar' or 'percent'.
  • discount -- The discount that will be charged to start the trial. Can be any number in decimal format without a currency symbol or percent symbol -- for example: 5.99 ...
  • product_id_0 -- An ID of a product that this transaction is for. Must be the ID of an already existing product in the database.

Optional Columns:

  • code -- The coupon code. This defaults to a randomly generated coupon code.
  • usage_amount -- Number of times the coupon can be used. Can be any valid, whole number. Defaults to 0 (which means unlimited).
  • expires_at -- The expiration date of the transaction. Must be in the format "YYYY-MM-DD hh:mm:ss". Defaults to null.
  • product_id_N -- This actually represents a dynamic number of columns ... it is an ID of a product that this transaction is for. The 'N' references any whole number. The first product_id_0 is a required field but many columns that are numbered can be present.

 

Rules CSV Format

Required Columns:

  • type -- The type of the rule. Can be 'single_post', 'category', 'tag', 'all_posts', 'single_page', 'parent_page', 'all_pages', 'partial', 'custom' or any number of custom post type rule types in the format 'single_forum' / 'all_forums' ...
  • target -- The text that goes along with the rule, for 'single_*' it should be the ID of an existing post or page, for 'all_*' or 'partial' should be blank, for 'category' or 'tag' should be the text of the tag or category, for 'custom' should be a request_uri or the regexp of a request_uri.
  • product_id_0 -- An ID of a product that this transaction is for. Must be the ID of an already existing product in the database.

Optional Columns:

  • regexp -- Only applicable if type="custom" ... if set to 1 it will interpret the target as a regular expression. If set to 0 the target will be interpreted as a normal string. Defaults to 0.
  • drip -- Controls whether or not there's a drip for this rule. Can be 1 for true or 0 for false. Defaults to false.
  • drip_type -- Drip type can either be 'days', 'weeks', 'months' or 'years'. Defaults to 'days'.
  • drip_duration -- The duration of the drip (number of days, weeks, months or years). Can be any whole number. Defaults to 0.
  • drip_trigger -- The event that triggers the drip. Can be 'registers' or a valid product ID. Defaults to 'registers'.
  • expire -- Controls whether or not there's an expiration for this rule. Can be 1 for true or 0 for false. Defaults to false.
  • expire_type -- Expire type can either be 'days', 'weeks', 'months' or 'years'.
  • expire_duration -- The duration of the expiration (number of days, weeks, months or years). Can be any whole number. Defaults to 0.
  • expire_trigger -- The event that triggers the expiration. Can be 'registers' or a valid product ID. Defaults to 'registers'.
  • product_id_N -- This actually represents a dynamic number of columns ... it is an ID of a product that this rule protects. The 'N' references any whole number. The first product_id_0 is a required field but many columns that are numbered can be present.