Marketing · Gutenberg

Coupon block for WordPress

Eye-catching promo/discount coupon card with copyable code, expiry countdown, and flexible styling.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Eye-catching promo/discount coupon card with copyable code, expiry countdown, and flexible styling.

Inspector panels on this block: Content, Coupon Code, Expiry, CTA Button, Badge, Appearance. Those titles come from index.js, not from a shared template.

Behavior controls: “Discount type” options: Percentage (%), Fixed amount, Free shipping, Buy one get one, Custom label; “Expiry date” (Format: YYYY-MM-DD or any readable date); “Badge shape” options: Circle, Rounded, Pill; “Badge position” options: Top right, Top left, Inline.

Where to find it

Gutenberg inserter → Marketing → search “Coupon” (block name `blockenberg/coupon` in block.json). Style it in the sidebar after insert.

How to use Coupon block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Coupon”, insert it. Category: Marketing.
  3. Configure inspector controls that exist on this block. Open Content. Set “Content — Title”, “Description”, “Discount type”, “Discount value / label”.
  4. Check the published page. The view script reads HTML data attributes: data-copied-label, data-copy, data-expiry. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Content — TitleText field in the inspector. block.json default: Exclusive Offer. Saved as `title`.
DescriptionMultiline text field in the inspector. block.json default: Use this code at checkout and save on your order.. Saved as `description`.
Discount typeSelect control; the chosen value is saved on the block. Options: Percentage (%); Fixed amount; Free shipping; Buy one get one; Custom label. block.json default: percent. Saved as `discountType`.
Discount value / labelText field in the inspector. block.json default: 40. Saved as `discountValue`.
Show codeOn/off toggle in the inspector. On by default. Saved as `showCode`.
CodeText field in the inspector. block.json default: SAVE40. Saved as `code`.
Code labelText field in the inspector. block.json default: Coupon Code. Saved as `codeLabel`.
Copy button labelText field in the inspector. block.json default: Copy. Saved as `copyLabel`.
Copied! labelText field in the inspector. block.json default: Copied!. Saved as `copiedLabel`.
Show expiryOn/off toggle in the inspector. On by default. Saved as `showExpiry`.
Expiry dateText field in the inspector. Format: YYYY-MM-DD or any readable date. Saved as `expiryDate`.
Expiry labelText field in the inspector. block.json default: Offer expires:. Saved as `expiryLabel`.
Show live countdownOn/off toggle in the inspector. On by default. Saved as `showCountdown`.
Show buttonOn/off toggle in the inspector. On by default. Saved as `showButton`.
Button textText field in the inspector. block.json default: Claim Discount. Saved as `buttonText`.
Button URLText field in the inspector. block.json default: #. Saved as `buttonUrl`.
Open in new tabOn/off toggle in the inspector. Off by default. Saved as `buttonNewTab`.
Show fine print / noteOn/off toggle in the inspector. On by default. Saved as `showNote`.
Note textText field in the inspector. block.json default: * Terms and conditions apply.. Saved as `note`.
Show badgeOn/off toggle in the inspector. On by default. Saved as `showBadge`.
Badge shapeSelect control; the chosen value is saved on the block. Options: Circle; Rounded; Pill. block.json default: circle. Saved as `badgeShape`.
Badge positionSelect control; the chosen value is saved on the block. Options: Top right; Top left; Inline. block.json default: top-right. Saved as `badgePosition`.
Card styleSelect control; the chosen value is saved on the block. Options: Classic (strip); Card (flat); Minimal; Ribbon (accent). block.json default: classic. Saved as `style`.
Accent strip sideSelect control; the chosen value is saved on the block. Options: Left; Top; Right; Bottom. block.json default: left. Saved as `stripSide`.
Border radius (px)Numeric range control in the inspector. Range 0–40. block.json default: 16. Saved as `borderRadius`.
Max width (px)Numeric range control in the inspector. Range 280–900. block.json default: 540. Saved as `maxWidth`.
Accent / stripColor control in the inspector. block.json default: #6c3fb5. Saved as `accentColor`.
Card backgroundColor control in the inspector. block.json default: #ffffff. Saved as `bgColor`.
Title textColor control in the inspector. block.json default: #1f2937. Saved as `textColor`.
Description textColor control in the inspector. block.json default: #6b7280. Saved as `descColor`.
Badge backgroundColor control in the inspector. block.json default: #6c3fb5. Saved as `badgeBg`.
Badge textColor control in the inspector. block.json default: #ffffff. Saved as `badgeColor`.
Code backgroundColor control in the inspector. block.json default: #f5f0ff. Saved as `codeBg`.
Code textColor control in the inspector. block.json default: #6c3fb5. Saved as `codeColor`.
Button backgroundColor control in the inspector. block.json default: #6c3fb5. Saved as `btnBg`.
Button textColor control in the inspector. block.json default: #ffffff. Saved as `btnColor`.
Typography — TitleShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoTitle`.
Description (Typo Desc)Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoDesc`.
Code font size (px)Numeric range control in the inspector. Range 14–36. block.json default: 22. Saved as `codeFontSize`.
Button font size (px)Numeric range control in the inspector. Range 11–24. block.json default: 16. Saved as `btnFontSize`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Coupon block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Coupon”. It sits under Marketing. After insert, open Content and set “Content — Title”, “Description”, “Discount type”, “Discount value / label”.

What makes Coupon different from other Blockenberg blocks?

Eye-catching promo/discount coupon card with copyable code, expiry countdown, and flexible styling. Inspector labels on this block include “Content — Title”, “Description”, “Discount type”, “Discount value / label”.

Is the Coupon Gutenberg block free?

Yes. Coupon ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Coupon to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Content, Coupon Code, Expiry, CTA Button).

Related marketing blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Coupon from the Gutenberg inserter.

Get Blockenberg