Blog

2 Easy Ways to bulk generate multi WooCommerce coupon codes?

Bulk generate multi coupon codes
Table of Contents

Creating one single coupon in WooCommerce takes you only a few minutes, but what if you need to create fifty or a hundred coupons and assign each one to specific products or set specific conditions for them? This is a hard work that wastes your time and does not allow you to properly manage your business. The only solution to this problem is to bulk generate multi WooCommerce coupon codes.

With the help of the WooCommerce coupon code generator, you can create as many coupons as you need with just one click. Bulk coupon generator WooCommerce is a very useful plugin that allows site managers to save time and effort in creating multiple coupons at once.

In this post, you can learn 2 easy ways to bulk generate multiple WooCommerce coupon codes:

 Also, we introduce you to a functional plugin that, in addition to WooCommerce bulk generate coupons, provides you with the essential tools for managing and bulk editing them.

WooCommerce generate coupon code programmatically

One of the simplest methods to generate coupon code WooCommerce is adding a PHP snippet to the WordPress backend.

To make this PHP snippet work, we recommend you take the below into consideration:

  • Don’t use this method if you have no experience in code writing or working with function.php file.
  • Back up your site before running this code.
  • To make sure the basic information of your website remains unchanged, first create a child theme, then insert this code into function.php file.
  • To trigger the function and make sure the coupons are generated, go to your WordPress admin URL with the “bb-gen-coupons” at the end like /wp-admin/admin.php?bb-gen-coupons. 
  • If you face any problems, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again.

Here, you can find the PHP code to bulk generate multi WooCommerce coupon code:

/**
 * @snippet    Bulk Generate Coupons @ WordPress Admin
 * @how-to    Get CustomizeWoo.com FREE
 * @author    Rodolfo Melogli
 * @compatible  WooCommerce 6
*/
add_action( 'admin_init', 'bbloomer_generate_coupons_admin' );
function bbloomer_generate_coupons_admin() {
 if ( isset( $_REQUEST['bb-gen-coupons'] ) ) {  
  if ( ! current_user_can( 'manage_WooCommerce ' ) ) {
     wp_die( 'You do not have permission to bulk generate coupons' );
  }  
  $number_of_coupons = 100; // DEFINE BULK QUANTITY  
  for ( $i = 1; $i <= $number_of_coupons; $i++ ) {
     $coupon = new WC_Coupon();     $random_code = bin2hex( random_bytes( 8 ) ); // 16 CHARS PHP 7+ ONLY
     if ( wc_get_coupon_id_by_code( $random_code ) ) continue; // SKIP IF CODE EXISTS
     $coupon->set_code( $random_code );
     $coupon->set_description( 'Coupon generated programmatically ('. $i. '/'. $number_of_coupons. ')' );
     $coupon->set_discount_type( 'percent' );
     $coupon->set_amount( 20 );
     $coupon->set_minimum_amount( 1 );
     $coupon->set_individual_use( true );
  $coupon->set_product_categories( array( 54, 55 ) );
     $coupon->set_usage_limit_per_user( 1 );
     $coupon->save();   
  }
 }
}

After running this code, 100 coupons will be generated successfully on your WordPress site as illustrated below:

result created coupons in WooCommerce

If you need to bulk generate more or fewer coupons, change the number in front of $number_of_coupons – highlighted in yellow.

Use WooCommerce coupons bulk edit plugin as WooCommerce bulk coupon generator

Using the WooCommerce coupons bulk edit plugin enables you to create bulk WooCommerce coupons. You can create as many identical coupon codes as you need, all of which will apply the same discount to your customers. Even better, you can bulk edit coupons after creating them.

Most WooCommerce coupon code generators only allow you to generate new coupons. While the WooCommerce coupons bulk editing plugin has a Duplicate tool. With this tool, you can clone as many existing coupons as you need.

Also, if you want unique WooCommerce discount codes for the created coupons, you can use the plugin because it will automatically generate a unique WooCommerce code for each coupon.

In the following, we will show you how to generate coupons in bulk using the coupon generator for the WooCommerce tool.

Step 1: Install WooCommerce coupons bulk edit plugin

By downloading and installing the WooCommerce coupons bulk editing plugin on your website, you have access to all tools required to bulk generate and bulk edit multi WooCommerce coupon code.

To use this bulk coupon generator WooCommerce navigate to the below Address:

WordPress Dashboard > iT Bulk Editing > Woo Coupons

select Woo Coupons section in Bulk Editing menu

On this page, you can find a comprehensive toolbar and a list of all coupons in a table. In the Toolbar designed on top of the table, there are two helpful tools for WooCommerce generate coupon code, which are:

  • New wooCommerce coupon generator
  • WooCommerce coupon duplicator

Now, let’s see how these tools help you to WooCommerce create coupon codes.

WooCommerce coupon bulk edit

Step 2: Generate coupon code WooCommerce 

In WooCommerce coupons bulk editing plugin, you can use one of the below methods to bulk generate coupon code WooCommerce :

  1. Bulk generate new WooCommerce coupons.
  2. Bulk duplicate existed WooCommerce coupons.

Read the following step by step guide to get familiar with both methods.

Method #1: WooCommerce bulk generate new coupons

If you need to use random coupon code generator WooCommerce for bulk creating new coupons, try to:

  • Press the New coupon generator icon in the toolbar.
select new coupon generator icon in toolbar
  • In the prompted pop-up, write the number of coupons you want to bulk generate. For example, we decided to generate 10 new coupons.
  • Press the Create button.
select number coupons in Bulk Editing Plugin

That’s it. The WooCommerce bulk generated coupons have been done successfully. 

result bulk generate multi WooCommerce coupon codes in Coupons bulk editing plugin

After generating new coupons, you need to edit some features like discount type, discount amount, products, etc.

In the WooCommerce coupons bulk editing plugin, there are three methods for making changes on different fields of coupons including:

  • Inline editing: Edit one field of a single WooCommerce coupon directly in the table.
  • Bind editing: Edit one field of multiple WooCommerce coupons in the table.
  • Bulk editing: Edit multiple fields of multiple WooCommerce coupons.

Let’s try to change some coupon fields with these methods.

Inline edit discount type of coupon

After bulk generating coupons, all of them have the same discount type. To change this field by inline edit, follow the below steps:

  • Press the Column Manager icon from toolbar to open the Column Manager form.
select column manager icon in toolbar
  • In this form mark Discount type and press the Apply to table button.
select discount type field in column profiles form
  • Open the dropdown list of Discount types related to one of the coupons.
  • Choose one of the Discount Types from the list.
result discount type field in coupons list

Bind edit products assigned to the WooCommerce coupon

By following the below steps, you can bind edit products assigned to multiple WooCommerce coupons:

  • Add products column to the table by marking the field in the Column manager form.
  • Select some coupons in the table (1).
  • Press Bind Edit icon in the toolbar (2).
  • Click on the Products field related to one of the selected coupons (3).
select bind edit icon in toolbar
  • In the displayed pop up, choose the products you want to be assigned to these coupons from the list then press Save Changes.
add products to coupon

Wait a few seconds and the WooCommerce bulk coupon generator will make changes appropriately.

Method #2: Duplicate coupons to WooCommerce create coupon code

Duplicating coupons is the next method for creating new coupons in this coupon code generator WooCommerce plugin. 

To clone some existing coupons, first, try to filter the coupons you want to duplicate

In the WooCommerce coupons bulk edit plugin, a comprehensive Filter Form supporting all WooCommerce coupon fields. To open this form, press the first icon in the toolbar. Then set your desired filters in different fields and finally press Get Coupons to see the filtered coupons in the table.

For example, if you want to filter coupons with Percentage discount type, you can choose this option from the list of Discount types in the filter form as illustrated below: 

duplicate coupons to create coupon code in filter form

Then by clicking on Get Coupons button, all WooCommerce coupons with Percentage Discount type will be displayed in the table.

Now, you are ready to duplicate them by following the below steps:

  • Mark some WooCommerce coupons on the table.
  • Press the Duplicate icon in the toolbar.
select duplicate icon in toolbar
  • Write how many times you want to duplicate the WooCommerce coupons. For example, we tried to duplicate the coupons 3 times.
select number duplicate in Bulk Editing Plugin
  • Press the Start duplicate button.

Your task has been done successfully. As you may notice in the below picture, all selected coupons are duplicated 3 times:

result duplicate coupons in list

Now, let’s see how you can bulk edit some fields of the bulk generated coupons

Bulk edit WooCommerce coupon amount field

Suppose that you want to set the Coupon Amount of all bulk generated coupons to 20. To make this happen, follow the below instructions:

  • Mark WooCommerce coupons in the table.
  • Click on the Bulk Edit icon in the toolbar to open the bulk edit form.
select bulk edit icon in toolbar
  • In the General tab of the Bulk Edit form, find the Coupon Amount field.
  • Open the Operator list and choose Set New.
  • Write 20 in the text box.
  • Press the Do Bulk Edit button.
select coupon amount field in bulk edit form

As shown below, all Coupon Amount have been changed successfully as we expected.

result coupon amount field in list
WooCommerce coupon bulk edit

Why do you need to bulk generate multi WooCommerce coupon codes?

If you set up an online store with WooCommerce and want to generate multiple coupons to offer to customers, WooCommerce bulk  coupons will save you a lot of time!

Store managers need to generate a large number of coupons for several important reasons.

The first reason is the ability to evaluate the performance of various marketing campaigns. One of the biggest disadvantages of using a single code for multiple users and marketing campaigns is that you can’t be sure which one exactly encouraged the customers and motivated them to buy. For example, if you use the same coupon code on both your Instagram marketing and email marketing, how can you determine which method has a better performance?

The second reason for using multiple coupons is to assign them to different customers. This way, you can check which coupons are the most used, how many customers are using them, and when they are using the discounts.

Many online store managers only use a few limited coupon codes just because it takes a lot of time to create coupons in WooCommerce, and this mistake makes them unable to plan their marketing strategies.

But there is a simple solution to this problem. WooCommerce bulk coupon generator plugin is an ideal way to create WooCommerce bulk coupons and use them in any way you want. For example, you can create random coupon codes and use each one for a separate marketing campaign.

Conclusion

Bulk generate multi WooCommerce coupon code is a great solution when you need to create a large number of coupons with random coupon codes in a few seconds. If you want to eliminate manual work, save time, and avoid the hassle of creating coupon codes individually, WooCommerce coupons bulk edit plugin is the recommended option.

With the WooCommerce coupons bulk edit plugin, you can create WooCommerce bulk coupons in two ways:

  • Create multiple new WooCommerce coupons.
  • Duplicate existing WooCommerce coupons.

This advanced plugin also allows you to bulk edit coupon fields and has hundreds of other useful tools and features.

Leave a Reply

Your email address will not be published. Required fields are marked *

Shopping cart
Sign in

No account yet?

We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies.

Start typing to see products you are looking for.