You can add coupons in your WordPress Dashboard one-by-one, or you can import them if you'd like. However, at this time, there is no UI for coupon code importation. Until we add this in, see short-term workaround.

To Add Coupons via the Dashboard

See: WordPress Dashboard s2Member Pro Coupon Codes


To Import Coupon Codes via Import File

1. Create this directory and file:


add_action('init', function(){
  if(empty($_GET['s2_new_coupons']) || $_GET['s2_new_coupons'] !== '[secret key]')
    return; // Not a coupon addition request, or not a valid key.

    return; // Coupon file does not exist.

  $new_coupons = trim(file_get_contents(ABSPATH.'s2-new-coupons.txt'));
  $GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_coupon_codes'] .= "\n".$new_coupons;
  update_option('ws_plugin__s2member_options', $GLOBALS['WS_PLUGIN__']['s2member']['o']);
  exit('New coupons added successfully!');

2. Change [secret key]

In the above code, change [secret key] to a random password that only you know.

3. Create a file containing your new coupon codes.

Format (one per line):


For additional details on each of these fields, see: WordPress Dashboard s2Member Pro Coupon Codes

Example file: /s2-new-coupons.txt


4. Upload /s2-new-coupons.txt

Upload /s2-new-coupons.txt via FTP, to the root of your WordPress installation; i.e., in the same directory as /wp-config.php. Once you're done with the next step, you can remove this file. It is only needed for the import. After that, you can delete it if you'd like.

5. Access this URL in your browser to do the import.[secret key]

You should see a message that reads:

New coupons added successfully!

Check your Dashboard to confirm the import worked as expected.