Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Jonjie's avatar
Level 12

How can I add unique url for coupon in wordpress

I know this is out of topic with laravel but I still want to try to ask.

So I'm trying to follow this tutorial but what I want to do is a bit different.

I want to have a unique link per coupon generator and the coupon is per customer and can only be used once (e.g. example.com/coupon/7AD8679adO).

Now I want to have a form for this page and just have a input boxes for users like first_name, last_name, and email. And the email field is the identifier that the current url coupon will be registered to that email.

I also tried to research and I found out that there's URL Coupons feature from Woocommerce (Not sure though if this is exactly what Im looking for), but suddenly, it is not free. So, any idea with this?

0 likes
7 replies
newbie360's avatar

one-to-many ?

--- customers TABLE ---

id

--- coupons TABLE ---

id | code (unique) | customer_id | used_at (nullable)

Jonjie's avatar
Level 12

@newbie360 Thanks for helping, but it is not a laravel related question; it is for wordpress. Im also thinking maybe Im just gotta create my own plugin instead?

newbie360's avatar

i don't know about wordpress, but i think implement this is not that hard ?

Jonjie's avatar
Level 12

I hope so, just need more time to better understand the syntax and how plugins works. Just hoping if someone already did this kind of feature, but hey thanks man

siangboon's avatar

i think you meant random unique code instead of url....

it is similar like email verification (you can search in Laracast, there should have few lessons), simply generate a random string and store in the coupon table...

Jonjie's avatar
Level 12

@siangboon Yeess, it is actually unique coupon code. But unfortunately it is not a laravel related feature; it is for wordpress. Just tried the woocommerce but I cannot proceed since it is not free. I'm also thinking if Im just gonna create my own plugin instead?

siangboon's avatar
Level 54

it's not too complicated... basically you just need a table to keep track the user id and the generated code...

Please or to participate in this conversation.