Membership site owners create discount codes for many reasons: seasonal promotions, partnership offers, and one-time events. After a while, it’s not always clear why a code exists or how it was meant to be used.
This code recipe adds a Description field to the admin view of each discount code, giving you a place to note its purpose, terms, or any other internal details.
Understanding the pmpro_discount_code_after_settings Hook
This recipe uses the pmpro_discount_code_after_settings action hook to add a custom field to the Discount Code edit screen. It hooks into the admin interface where discount codes are managed, so the new field fits in naturally.
Related: Discount Code Documentation
About the Code Recipe
This recipe will add a Description textarea field to the Discount Code edit screen when editing a discount code. You must save the discount code at least once before you can add a description.

Only site admins see the field; it’s not shown on the checkout page or to members. It’s meant purely for internal use.
The Code Recipe
This recipe works on any site running Paid Memberships Pro. No additional Add Ons are required, and no customization is needed.
Adding the Recipe to Your Website
You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.


