// DOCS / bulk-coupon-generator
Bulk Coupon Generator
Before you start
Bulk Coupon Generator is a WooCommerce extension, not a standalone plugin. WooCommerce must be installed and active — without it the plugin shows an admin error and stops before loading anything else.
You will also need WordPress 6.0 or newer, WooCommerce 7.0 or newer, and PHP 7.4 or newer, plus an administrator account. Every screen is gated on the manage_options capability, so editors and shop managers cannot see or use it.
Install and activate
- Download the plugin from your account at ptova.com/account, or from the link in your purchase email.
- In WordPress, go to Plugins → Add New → Upload Plugin, choose the
.zip, and activate it. - Open Ptova → Bulk Coupons → License, paste the key from your purchase email, and click Activate.
Once the license is active, update notices appear in WordPress like any other plugin. Nothing else needs configuring, and there is no API key or token to manage.
The plugin adds three screens under Ptova → Bulk Coupons:
| Screen | What it does |
|---|---|
| Bulk Generate Coupons | The form that creates a batch |
| Coupon Batches | Every batch you have generated, and how many codes have been redeemed |
| Coupon Automations | Rules that generate and email codes when an order completes |
Generate your first batch
Open Bulk Generate Coupons, fill in the form, and submit. You will get your codes in a few seconds.
The only genuinely required fields are quantity and discount amount. Everything else has a sensible default.
- Quantity — between 1 and 1,000 per batch. The form rejects anything outside that range rather than silently truncating. For more than 1,000 codes, run the form again; batches are independent.
- Discount amount — must be greater than zero.
- Discount type — percentage, fixed cart, or fixed product.
Every code produced is a real WooCommerce coupon. It appears under WooCommerce → Coupons alongside any coupon you made by hand, and it redeems at checkout in exactly the same way. Nothing about redemption runs through this plugin, which is why codes keep working regardless of what happens to the plugin later.
Codes are generated with random_int, PHP’s cryptographically secure random number generator — not rand() or a timestamp. Two batches will not collide, and codes are not guessable from one another.
Controlling how codes look
A code is built as prefix + random body + suffix. Prefix and suffix are optional and are used verbatim.
Length applies to the random body only, and is clamped to between 4 and 40 characters. Values outside that range are pulled to the nearest limit rather than rejected.
Character set offers five options:
| Option | Characters |
|---|---|
| Uppercase + digits, no look-alikes | A–Z 2–9, skipping I O 0 1 |
| Uppercase + digits | Full A–Z 0–9 |
| Uppercase letters only | A–Z |
| Digits only | 0–9 |
| Mixed case + digits | a–z A–Z 0–9 |
Use the no-look-alikes set for anything a human will read aloud, type from paper, or hear over a phone. It removes the four characters people reliably confuse. The full sets buy you slightly shorter codes for the same number of combinations, which only matters at large quantities.
Discounts and restrictions
Each batch carries the same restrictions across all its codes:
- Usage limits — per coupon and per user.
- Minimum and maximum spend. The form rejects a minimum greater than the maximum rather than generating coupons that can never be redeemed.
- Expiry date. Anything PHP’s
strtotimeunderstands is accepted; unparseable dates are rejected. - Individual use only — the coupon cannot be combined with others.
- Free shipping.
- Product and category restrictions, including exclusions.
If you need two different restriction sets, generate two batches.
Tracking redemptions
Coupon Batches lists every batch with its settings and its redeemed-versus-issued count.
Open a batch to:
- See each code and whether it has been used.
- Jump straight to the order behind any redemption.
- Copy every code, or copy only the codes still unused — useful when you are topping up a campaign and do not want to re-send codes that are already spent.
Deleting a batch removes the record. You choose whether to delete the underlying WooCommerce coupons at the same time; leaving them in place means codes already in customers’ hands keep working.
Automations
Coupon Automations generates a batch automatically when an order completes, and emails it to the customer. The usual case is a voucher or reward attached to a specific product.
A rule watches for a product. When an order containing that product reaches the Completed status, the rule fires: it generates codes and sends them to the order’s billing email.
Three details worth knowing:
- Only the Completed status triggers a rule. Processing, on-hold and paid-but-not-completed orders do not. If your shop never moves orders to Completed, automations will never fire.
- A rule fires once per order. The plugin records which rules have run against each order, so re-saving or re-processing an order does not send a second batch.
- Quantity can follow the amount purchased, so someone buying five of a product can receive five codes.
Emailing codes
Both the batch form and automations can send codes as branded HTML email, with CC and BCC and a customer-lookup field for picking a recipient from existing customers.
When Send by email is ticked, the recipient address, subject and body all become required — the form will not let you send a blank email.
Templates support placeholders that are filled in at send time:
| Placeholder | Value |
|---|---|
{codes} |
All codes, in a formatted box |
{count} |
How many codes |
{discount_summary} |
A friendly summary, e.g. “20% off” |
{amount}, {discount_type} |
The raw amount, and the type slug |
{expiry}, {expiry_line} |
The date, or a full sentence about expiry |
{recipient_name}, {recipient_email} |
Who it is going to |
{site_name}, {site_url} |
Your shop |
{products}, {categories} |
What the coupon is valid for |
{excluded_products}, {excluded_categories} |
What it excludes |
Automation emails add order and customer placeholders on top: {order_number}, {order_total}, {order_date}, {customer_name}, {customer_first}, {customer_email}, {product_name} and {product_quantity}.
Mail goes out through WordPress, so it uses whatever SMTP or transactional-email plugin your site already has. If your shop’s other emails arrive, these will too.
Troubleshooting
The plugin shows an error about WooCommerce. WooCommerce is not active. The plugin deliberately stops rather than half-loading against a missing dependency.
The menu is not there. Every screen requires the manage_options capability. Shop managers and editors will not see it.
“Quantity may not exceed 1000 per batch.” That limit is enforced, not advisory. Run the form again for another batch.
“Minimum spend cannot be greater than maximum spend.” The two are the wrong way round. Left as-is, the coupons could never be redeemed, which is why it is rejected up front.
An automation did not fire. Check that the order reached Completed, and that the rule has not already run for that order — rules fire once per order by design.
Codes are not arriving by email. The plugin hands mail to WordPress. If other WordPress email from the site is also failing, the problem is your site’s mail configuration rather than this plugin.
Codes are hard to read over the phone. Regenerate with the no-look-alikes character set, which removes I, O, 0 and 1.
Getting help
Email hello@ptova.com. Include the first block of your license key — for example PTOVA-7X2K — so we can find your account. Never send your full key.