Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Easily Add a Coupon Code Field to Your WordPress Forms

Want to know a secret? The easiest way to boost sales on your WordPress store isn’t fancy marketing. It’s offering simple discounts.

But when we launched our first online stores, adding a coupon code field to our forms felt complicated and expensive. We had no idea where to start.

We then tried many tools and tested different methods. In the end, we found that WPForms makes it the easiest to add coupon code fields to your WordPress forms.

Since then, we’ve helped lots of business owners do the exact same thing.

In this guide, we’ll show you exactly how to add a coupon code field to your WordPress forms. Want to run seasonal sales, reward loyal customers, or launch a promo? We’ve got you covered! You can set it up in minutes — no coding required. 🙌

Add coupon code field to your WordPress forms

Why Add Coupons to Your WordPress Forms?

Adding a coupon code field to forms on your WordPress website can encourage users to buy from you.

For example, if you have an order form for your restaurant, then adding a coupon code for discounts can help attract new customers and encourage repeat purchases.

You can also use coupons to promote clearance sales or new products in your online store, celebrate events, or reward loyal customers.

Additionally, you can use a coupon code field to build an email list by offering discount codes to customers who sign up as subscribers.

That being said, we’ll share how to easily add a coupon code field in WordPress forms. Here’s a quick overview of all the things we’ll cover in this guide:

Let’s get started.

Create Coupon Code Field in WordPress Forms

You can easily add a coupon code field in WordPress forms using WPForms.

It’s the best WordPress contact form plugin on the market that comes with a drag-and-drop builder and makes it super easy to create any kind of form you want.

AT WPBeginner, WPForms powers a lot of our forms, including the contact form, annual reader surveys, and site migration request form. We always have great experiences with it, and we strongly recommend you check out our full WPForms review for details!

WPForms homepage

First, you will need to install and activate the WPForms plugin. For detailed instructions, see our step-by-step guide on how to install a WordPress plugin.

📝 Note: WPForms also has a free version. However, you will need a Pro plan to unlock the Coupons addon. Upgrading to Pro also gives you access to many other advanced tools, like AI Calculations and smart conditional logic to help you create smarter forms.

Upon activation, head over to the WPForms » Settings page from the WordPress admin sidebar and enter your license key.

You can get this information from your account on the WPForms website.

Entering the WPForms license key

Next, visit the WPForms » Addons page from the WordPress admin area and search for the Coupons addon.

Once you have done that, just click the ‘Install Addon’ button to download and activate it on your website.

Install the Coupons addon

After the addon has been activated, head over to the WPForms » Payments page from the admin area and switch to the ‘Coupons’ tab.

From here, click the ‘+ Add Coupon’ button to continue.

Click + Add Coupon button

This will take you to the ‘Add New Coupon’ page, where you can start by typing a name for your coupon. Keep in mind that this name won’t be displayed for your users and is just for your reference.

After that, you have to type the code that visitors will use to get a discount on your website.

If you don’t want to create custom code, then simply click the ‘Generate Code’ button to let WPForms generate code for you.

Add a name and code for the coupon

Next, you need to add the amount or percentage discount that customers will receive upon using the coupon in the ‘Amount’ field.

Once you have done that, you can also add a start date and end date for the coupon code. For example, if you want to create a coupon that will only be valid for a week, then you can add that as an expiration date in the field.

After that, you must add the maximum number of times a single user can use the coupon code in the ‘Max Uses’ field.

Add amount and time for the coupon code

Now, scroll down to the ‘Allowed Forms’ section on the page.

From here, toggle the switch next to the form where you want to enable the coupon code.

Finally, click the ‘Save Coupon’ button to store your settings.

Allow coupon code field for forms

Add the Coupon Code to a WordPress Form

Next, you must open the form where you want to add the coupon code field.

To do this, visit the WPForms » All Forms page from the WordPress dashboard and click the ‘Edit’ link under the form where you want to add a coupon field.

Edit form

This will launch the form in the form builder.

For this tutorial, we will be adding a coupon code field to a takeout order form.

Here, you will notice available form fields in the left column and a form preview on the right side of the screen. Simply drag and drop the ‘Coupon’ field into the form.

Add coupon code field to the form

Once you have done that, click on the field to open its settings in the left column.

Next, choose the coupon that you created earlier from the ‘Allowed Coupons’ dropdown menu.

Choose a coupon code from the dropdown menu

After that, you can add a label or description for the coupon field and also toggle on the ‘Required’ switch.

If you do this, then users won’t be able to submit the form without filling in the coupon code.

Save form with the coupon code

Next, switch to the ‘Payments’ tab to configure settings.

With WPForms, you can easily accept payments from popular gateways like Stripe, PayPal, Authorize.net, and more.

All you have to do is activate the addon for the gateway of your choice and then toggle the switch to enable it from the form builder.

Add a payment gateway of your choice

For more detailed instructions, you may want to see our tutorial on how to create a WordPress form with payment options.

Next, switch back to the ‘Fields’ tab and drag and drop the field for the payment gateway of your choice into the form.

Now, you will be able to accept payments directly from WPForms after the user applies the discount coupon code.

Add PayPal Commerce field

Once you are done, just click the ‘Save’ button at the top to store your settings.

Embed the WordPress Form Into a Page/Post

Now, it’s time for you to add the form with the coupon code to your WordPress site. Keep in mind that if the form where you added the coupon code field is already published on a page/post of your website, then it will automatically be updated.

However, if you haven’t added the form yet, then open an existing or new page/post from your WordPress dashboard.

From here, click the ‘+’ button to open the block menu and add the WPForms block.

After that, you need to choose the form with the coupon code field from the dropdown menu inside the block.

Add the WPForms block

Next, click the ‘Update’ or ‘Publish’ button to store your settings.

Now, you can visit your WordPress site to view the form with a coupon field in action.

Add form with coupon code

Set Up a Message for Coupon Errors

If you also want to display a message to users who enter the wrong coupon code, then you must visit the WPForms » Settings page from the WordPress sidebar.

From here, switch to the ‘Validation’ tab and scroll down to the ‘Coupon Error’ option.

After that, type the sentence that will be displayed to users upon entering the wrong code.

Add a coupon error message

Once you are done, just click the ‘Save Settings’ button to store your changes.

Now, if users enter the incorrect coupon code, then they will see your error message.

coupon code error preview

Track Coupon Usage With WPForms

With WPForms, you can also track the number of times your coupon was used to get a discount. This can help you see if your coupon codes and discounts are effective in driving sales.

To view your coupon usage, just visit the WPForms » Payments page from the WordPress admin sidebar.

Coupon entries graph

You will see a summary chart of coupon usage on your WordPress site in the ‘Overview’ tab.

From here, you can also click on the ‘Total Payments’ tab to view individual payments and see which customers used the coupon code on your site.

Coupon usage payments entries

This will help you decide if adding the coupon code field has helped you generate more revenue, and if it has been a successful campaign or not.

Bonus 💡: More Tips for Using Coupons in WordPress

Coupon marketing is one of the most effective ways to get more sales and grow customer loyalty. Apart from adding coupon fields to your WordPress forms, you can also use coupons to promote a new product, a clearance sale, special events, or more.

To do this, you can use the Advanced Coupons plugin, which is the best WordPress coupon code plugin. It lets you create a huge range of deals in your online store.

It easily integrates with WooCommerce and offers features like coupon URLs, scheduled coupons, auto-apply coupons, shipping coupons, and bulk coupons.

We’ve dived deep into its features, which you can see in our complete Advanced Coupons review.

Advanced Coupons

Additionally, you can create coupon popups to convert your website visitors into customers using OptinMonster.

It’s the best lead generation and conversion optimization tool that allows you to design attractive popups with discount coupon codes.

At WPBeginner, we use OptinMonster to offer special deals on a popups and header banners, among others. It’s been working exceptionally well for us, and you can explore its features in our extensive OptinMonster review.

Coupon popup

We’ve seen how this strategy can help recover abandoned cart rates, increase brand awareness, and improve conversions.

For more instructions, see our tutorial on how to create a coupon popup in WordPress.

We hope this article helped you learn how to easily add a coupon code field in WordPress forms. You may also be interested in our ultimate guide to WordPress forms and our expert picks for the best WooCommerce spin-a-wheel coupon plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

1 CommentLeave a Reply

  1. Jiří Vaněk

    I’m considering offering paid tutorials on the website. I want to avoid other platforms. Since I have WP FORM in the PRO version, it’s a good idea to provide tutorials for specific users on the website while also having the option to offer them a discount to entice them with a lower price.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.