---
title: How to Customize the “Coupon Is Not Valid” Message
description: "Customize the WooCommerce Coupon is not valid message for role-restricted coupons, with placeholders, HTML and shortcodes."
url: "https://wpfactory.com/docs/customize-coupon-not-valid-message/"
updated: "2026-10-05"
category: How to
---

# How to Customize the “Coupon Is Not Valid” Message

To customize the "Coupon is not valid" message in Coupon by User Role for WooCommerce, go to WPFactory > Coupon by User Role, open the Availability section, scroll to Message, and edit the "Coupon is not valid" message field. You can use the %coupon_code% and %coupon_amount% placeholders, HTML and shortcodes. Click Save changes.

### Where to change it

1. Go to **WPFactory > Coupon by User Role** (also reachable at **WooCommerce > Settings > Coupon by User Role**).
2. Open the **Availability** section and scroll to **Message**.
3. Edit the **"Coupon is not valid" message** field.
4. Click **Save changes**.

![Coupon is not valid message field with available placeholders in WooCommerce](https://wpfactory.com/wp-content/uploads/Per-Coupon.png)

### Options reference

| Label | Option ID | Type | Default |
| --- | --- | --- | --- |
| "Coupon is not valid" message | `wpjup_wc_coupon_by_user_role_invalid_message` | Textarea | Coupon is not valid for your user role. |

### Placeholders

Two placeholders are replaced when the message is shown:

| Placeholder | Replaced with |
| --- | --- |
| `%coupon_code%` | The code the customer tried to apply. |
| `%coupon_amount%` | The coupon's amount. |

Example message:

```
The code %coupon_code% is only available to registered customers. Sign in or create an account to use it.
```

### HTML and shortcodes are allowed

The message accepts HTML and shortcodes. That is what makes it translatable: drop in the `[alg_wc_cbur_translate]` shortcode to show a different message per language. See [multilingual coupon messages](https://wpfactory.com/docs/role-based-discounts/).

### When does this message appear?

Only for **invalidated** coupons. A **disabled** role has no coupon field at all, so it never sees this message. See [disable or invalidate coupons by user role](https://wpfactory.com/docs/effortless-targeted-promotions/) for the difference.

### Get more control

The message is free for all users. [Coupon by User Role for WooCommerce](https://wpfactory.com/item/coupon-by-user-role-for-woocommerce/) Pro adds custom-role targeting, so any role on your site can trigger its own invalidation message. [See what Pro unlocks](https://wpfactory.com/item/coupon-by-user-role-for-woocommerce/).

Related articles

- [Coupons by User Role: How to Reset a Settings Section](https://wpfactory.com/docs/reset-coupon-settings-section/)
- [Disable or Invalidate Coupons for Guests and Logged-Out Visitors](https://wpfactory.com/docs/guest-role-coupons/)
- [Coupons by User Role: Developer Hooks and Filters Reference](https://wpfactory.com/docs/coupon-by-user-role-hooks-filters/)
- [Coupon Role Rules Not Working: Fixes](https://wpfactory.com/docs/coupon-role-discounts-fix/)
- [Free vs Pro: Coupon by User Role for WooCommerce](https://wpfactory.com/docs/free-vs-pro/)
