Dynamic coupons

Want to streamline coupon creation for your affiliate program? Dynamic coupons in AffiliateWP allow you to automatically generate personalized coupons for affiliates, simplifying the process of assigning and managing affiliate coupons. Instead of manually creating a coupon for each affiliate, dynamic coupons can be automatically generated during registration or in bulk by the site admin.

How Dynamic Coupons Work

Dynamic coupons inherit their settings from a coupon template that you designate in WooCommerce. This ensures all dynamic coupons share the same configuration, such as discount amount, excluded products, or free shipping eligibility. If you need to update coupon settings later, you can simply adjust the template, and all dynamic coupons will automatically reflect the changes.

The following fields are inherited by dynamic coupons from the coupon template:

  • amount
  • discount_type
  • excluded_product_ids
  • excluded_product_categories
  • product_ids
  • individual_use
  • free_shipping
  • exclude_sale_items
  • date_expires

Enabling dynamic coupons

Create a new coupon (if needed) by going to Marketing » Coupons once you’ve installed and activated WooCommerce. Once your coupon is ready:

  • Go to AffiliateWP » Settings » Coupons in your WordPress dashboard.
  • Select the WooCommerce coupon you created as the Coupon Template.

Automatically generating dynamic coupons for affiliates

When affiliates join your program, dynamic coupons can be automatically generated for them.

To do this, enable the Automatically Generate Coupons option. You can find this option also on the AffiliateWP » Settings » Coupons screen:

Once enabled, a dynamic coupon will be automatically generated when:

  • An affiliate registers from the front-end using the default affiliate registration form.
  • Affiliate approval is enabled, and an affiliate is approved from either the Accept quick action link, the Bulk Actions menu, or from the Review Affiliate screen.
  • An affiliate is added manually from within the WordPress admin, and the Affiliate Coupon checkbox is enabled.
  • Affiliate accounts are created when the setting Automatically register new user accounts as affiliates is enabled in AffiliateWP » Settings » Affiliates.

Dynamic Coupon Customization

You can also customize how the coupon names will be formatted when generated with a coupon format, custom text, and a hyphen delimiter.

The coupon format merge tag names can be put together in any order desired:

  • {user_name}
  • {coupon_code}
  • {coupon_amount}
  • {custom_text}

For example, for an affiliate with the username of Alfred and a coupon discount amount of 10%, this would be {user_name}{coupon_amount}, resulting in Alfred10 as the actual coupon code generated.

There is also the option to insert a hyphen in between each coupon merge tag.

Bulk generating dynamic coupons

Dynamic coupons can be bulk generated for all affiliates that do not currently have a dynamic coupon.

Go to AffiliateWP » Tools » Coupons, and click the Generate Coupons button. A dynamic coupon will be generated for all active affiliates that do not already have a dynamic coupon assigned.

It is also possible to bulk generate dynamic coupons for all affiliates and override all existing dynamic coupons. If an affiliate already has a dynamic coupon, an entirely new coupon will be generated for them.

To override all dynamic coupons, enable the setting Override existing coupon for all affiliates. Then, click the Generate Coupons button.

Generating a dynamic coupon for a specific affiliate

A dynamic coupon can be generated for a specific affiliate.

Click the affiliate’s name from the AffiliateWP » Affiliates screen to go to their Edit Affiliate screen.

Next to Dynamic Coupon Code, click the Generate Coupon button if one does not exist, or, click Delete Coupon first if they already have a coupon code generated, but want a new one.

Dynamic Coupon Generate Coupon
Dynamic Coupon Delete Coupon

Deleting a dynamic coupon for a specific affiliate

A dynamic coupon can be deleted for a specific affiliate.

Click the affiliate’s name from the AffiliateWP » Affiliates screen to go to their Edit Affiliate screen.

Next to Dynamic Coupon Code, click the Delete Coupon button (see image above).

The coupon code will then be deleted.

Showing a dynamic coupon to the affiliate

Dynamic coupons can be shown to an affiliate from either:

  • The Affiliate Area
  • The affiliate accepted email

Affiliate Area

A new Coupons tab will show within the Affiliate account and the Affiliate Portal screens if:

  • An affiliate has a dynamic coupon code assigned to them.
  • An affiliate has one or more manually assigned coupon codes assigned to them.
Affiliate Account coupon

Application accepted email

You can use the {registration_coupon} email tag to include the dynamic coupon code in the acceptance email. You can configure this by editing the Application Accepted Email Content under AffiliateWP » Settings » Emails.

Frequently Asked Questions

What happens if an affiliate already has a manually assigned coupon?

Dynamic coupons cannot replace manually assigned coupons. You must delete the manually assigned coupon before generating a dynamic coupon for the affiliate.

Can I create a custom registration form that supports automatic dynamic coupon generation?

Currently, automatic coupon generation is only supported with default AffiliateWP registration forms. Custom forms built with plugins like Gravity Forms or Ninja Forms do not trigger automatic coupon creation.

What settings are not inherited from the WooCommerce coupon template?

Settings under Usage Limits (e.g., usage per coupon, usage per user) and specific restrictions like minimum/maximum spend or allowed emails are not inherited by dynamic coupons.

How can I test the dynamic coupon feature?

Create a test affiliate account and enable dynamic coupons for it. You can then verify that the coupon is generated, inherits the correct template settings, and appears in the Affiliate Area.

Is there a limit to the length of dynamic coupon codes?

Yes, the {user_name} merge tag is limited to 10 characters to ensure the generated coupon codes remain concise and functional.


That’s it! Dynamic coupons are a powerful feature in AffiliateWP, simplifying the process of managing affiliate coupons. By using dynamic coupon templates, you can ensure consistency across all coupons while easily updating settings as needed. With options for automatic or manual generation, as well as flexible customization, dynamic coupons save time and streamline your affiliate management process.

By following this guide, you’ll be ready to implement dynamic coupons effectively, helping your affiliates promote your business while maintaining control over coupon settings.