How to bulk import coupons with a CSV and MemberPress importer.

MemberPress, at least at the moment, doesn't have an option to generate a large number of coupons. That, however, doesn't mean that you can't create them, though it will require a bit of tinkering.

What you'd need is a way to generate a large number of coupon codes, and possibly, have some control over the generation process and have a way to export them when done. The Random Code Generator website fits all the requirements perfectly if you need up to 1000 coupons in one batch. If you need more than that, you'll have to register as a paying customer, which, considering what kind of control the website offers, is quite fair.

So, once you generate the coupons, export them as CSV file. You'll need it. You don't want your coupons to be a bunch of random characters, do you? :-)

According to our Migrating or Importing MemberPress Data tutorial, the only required columns are:

  • 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 a decimal format without a currency symbol or percent symbol -- for example 5.99 ...
  • product_id_0 -- An ID of a Membership that this transaction is for. Must be the ID of an already existing Membership in the database.
So, let's say that you have 250 members and you want to import a CSV file with 250 unique coupons and give them 10 per cent discount for the membership ID 75 (you can see the ID in MemberPress -> Memberships section, ID column).
What you need to do is to use a spreadsheet program like Google Sheets, Excel or anything similar. Open a new file. Create "type", "discount" and "product_id_0" columns as the mandatory ones and add "code" for the coupon code and "usage_amount" for the number of times a coupon can be used.
You'd start with something like this:

Then click on "percent" column and move your cursor until it turns into a crosshair by positioning it at the blue square in the bottom right corner (applies to Google Sheets, other spreadsheet programs have similar options):

Then simply pull it all the way down to match the number of coupons and you'll have this:

Repeat for the other columns and once you do that, you'll have a file that you can save as CSV and then import to MemberPress by going to Import section and selecting Coupons from the drop-down list:

And that's it. You've just successfully created 250 unique coupons that you can distribute to your members. You can download the short sample file from here.

If you need any other kind of coupon, just change the parameters and use the same procedure.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.