If you already have a list of customers, you can give them a membership in one go with a CSV file, instead of selecting them one by one. This feature is part of the Pro version.
The import only gives a membership to users who already exist on your site. It does not create any user. The plugin finds each user with the email address in the file.
Where to find it
The import is the group named Import Memberships.
Prepare your file
- The file must be a CSV file (the plugin refuses any file whose type is not text/csv).
- One user per row. Each value is in a column, and the first column is number 1.
- One column holds the user’s email address. It must be the email of an existing user.
- Optionally, another column holds a value that tells which rows must get the membership.
- Values can be enclosed in double quotes.
Here is the example the plugin shows on the page. The separator is a semicolon, and the first row is a header:
User;Email;Other Column;Membership;
John Doe;johndoe@anonymous.org;some data;VIP;
Jane Doe;janedoe@anonymous.org;some data;VIP;
Jim Doe;jimdoe@anonymous.org;some data;;
For this file, the plugin suggests these options:
- CSV Separator : ;
- First row is Header : Checked
- User email Column index : 2
- Membership Column index : 4
- Membership Conditional Value : VIP
With these options, John and Jane get the membership, and Jim does not, because his Membership cell is empty.
Set the options
- CSV separator : the character that separates the values in your file. The default is a comma. You can type \t for a tab.
- First row is Header : checked by default. If checked, the first row is skipped.
- User email Column index : the number of the column that holds the email address. The first column is 1. It must be a number greater than or equal to 1.
- Membership Column index : the number of the column the plugin tests to decide who gets the membership. Leave it empty to give the membership to every user of the file.
- Membership Conditional Value : the value to find in that cell to grant the membership. It accepts wildcard characters, for example * to match any value. It is only used when you set a Membership Column index. If you leave it empty, only the rows whose cell is empty match.
- Membership to grant : the membership the users get. Required.
- Membership Expiration Date : the date the membership ends for all the users of the import. Leave it empty for no time limit.
Then choose your file and click Generate Membership.
What the import does
- It skips the first row if First row is Header is checked.
- It skips any row that has fewer columns than the highest column index you set, without a message.
- It skips any row with an empty email, or an email that does not belong to a user, without a message.
- For each user found, it checks the Membership Conditional Value, then grants the membership.
- If the user already has the membership, the user keeps the start date and the expiration date is replaced by the one you set. With no expiration date, the membership becomes unlimited.
The result message
When the import ends, a message tells you how many users were read and how many memberships were granted:
- N Users read. N Membership (name) granted. without an expiration date
- N Users read. N Membership (name) granted up to date. with an expiration date
Users read counts the users found with their email address in the file, even those who did not match the condition. An existing member whose expiration date is already the one you set is not counted as granted.
Error messages
If something is wrong, nothing is imported and the plugin shows one of these messages:
- Missing or not supported CSV separator character : the separator field is empty.
- Please, set the column index of user email (must be a number greater or equal to 1)
- Please, choose a Membership to grant
- Sorry, we cannot find that Membership.
- Bad Date format : the expiration date is not a valid date.
- Expects a CSV file : the file type is not text/csv.
- Error during upload of file %s, perhaps the file is too big. You can try to split it up or increase max allowed file size on your server. : split your file or ask your host to raise the upload limit.
- Cannot open the file
- The file cannot be read or format is invalid
Two information messages can also appear: Membership is given without condition when you left Membership Column index empty, and Empty Condition Value matchs only empty cell. If it is not what you want, you may look for ‘*’ to match anything when you set a column but no value.
If you do not choose any file, nothing happens.