To add affiliate coupon codes in WordPress, use the Coupon block in Ultimate Blocks Pro. Visitors click the code to copy it, and the block opens your affiliate link in a new tab at the same time, so the discount and your referral are applied together. The Coupon block is a Pro block.
What you need #
- The free Ultimate Blocks plugin.
- Ultimate Blocks Pro, installed and activated alongside the free plugin.
- Your coupon code (or deal) and your affiliate link from the brand or affiliate network.
How to add a coupon code #
- Open the post or page in the WordPress block editor.
- Click +, search for Coupon and click the block to add it.
- Fill in the block right on the page: the discount (for example “30%”), the coupon or deal label, the title, the code and a short description.
- In the Settings tab, open the General panel and set Coupon Type to Coupon.
- Paste your affiliate link into Link To Navigate On Copy (Affiliate Link).
- Set the expiry (see below), then click Update or Publish.
How the affiliate link works #
When a visitor clicks the code button, the code is copied and the link in Link To Navigate On Copy (Affiliate Link) opens in a new tab. The visitor can paste the code at checkout right away. The coupon links are added with rel="nofollow noopener", which is the usual way to mark paid or affiliate links.
Coupon or Deal? #
| Type | Use it when | What visitors click |
|---|---|---|
| Coupon | There is a code to enter at checkout. | The code button (“Click To Copy Coupon”) copies the code and opens your link. |
| Deal | No code is needed, such as a sale price or free trial. | A Get Deal button opens your link. You can change the button text. |
Hide the coupon code #
Hiding the code makes visitors click before they see it, which is common on coupon sites. This option is available when Coupon Type is Coupon.
- In the General panel, turn on Hide Coupon.
- Set the text of the button that hides the code (Hidden Coupon Text), for example “Show code”.
- Set Popup Copy Button Text and Popup Offer Button Text.
Visitors click the button and a popup shows the code with a copy button and an offer button. The offer button opens your link in a new tab.
Set an expiry date #
- Expiration Date: pick the last day of the offer. The coupon shows “Expire On” followed by the date.
- Expired Date Label: “This text will show when coupon date is expired.” For example, “This coupon has expired”.
- Doesn’t Expire: turn this on for offers with no end date. You can then type your own text, such as “No expiry date”.
Tip: Check your coupons every month. Expired codes frustrate readers, and replacing them with fresh codes keeps your post useful.
Add an affiliate disclosure #
In many countries, including the US under FTC guidance, you should tell readers when you may earn money from a link. Some simple rules (this is general information, not legal advice):
- Put a short, plain disclosure near the coupon, before readers click. For example: “We may earn a commission if you buy through this link.”
- Make it easy to see. A paragraph above the Coupon block works better than a note in the footer.
- Use clear words. “Affiliate link” or “we earn a commission” is clearer than vague wording.
Style the Coupon block #
The Styles tab has colors for each part (title, description, code, discount, label, dates and popup buttons) with Normal and Hover states, font sizes for each text, and borders such as Wrapper Border, Code Border and Separator Border.
Frequently asked questions #
Is the Coupon block free?
No. The Coupon block is one of the Pro blocks in Ultimate Blocks Pro.
Does the affiliate link open when visitors copy the code?
Yes. Clicking the code copies it and opens the link from Link To Navigate On Copy (Affiliate Link) in a new tab.
Can I hide the coupon code until visitors click?
Yes. Turn on Hide Coupon in the General panel. Visitors then see the code in a popup with a copy button and an offer button.
What is the difference between a coupon and a deal?
A coupon has a code to enter at checkout. A deal has no code and shows a Get Deal button that opens your link.
What shows when a coupon expires?
After the Expiration Date, the block shows your Expired Date Label text, such as This coupon has expired.