You build a voucher code website by pairing three things that are easy to describe and hard to get right at the same time: a database of codes that never shows a dead offer, a public site that stays fast and search-visible, and a revenue model that survives advertiser non-payment. Start with the data model and the verification rules, not the design. If a code is wrong, users leave and merchants stop paying, and no amount of polish fixes that. The rest of this guide walks through the sequence I'd actually follow, from schema to launch, including the parts most tutorials skip, like how to expire codes, how to detect fraud, and what it costs to run.
The mechanics are stable enough to plan around: affiliate networks, server-rendered pages, and a relational database cover most of it. What changes is which merchants pay, which networks are open to new publishers, and how search engines treat thin coupon pages, so treat every number below as an illustrative input and verify the current terms before you commit money.
What a voucher code website is, and what it actually earns
A voucher code site publishes discount codes, promo codes, and deal pages, then sends visitors to the merchant through an affiliate link. When a visitor clicks through and buys something, the merchant or its affiliate network pays you a commission, typically a percentage of the sale or a flat fee per action. That's the whole business model in one sentence.
Two details shape the build. First, you don't get paid for the click, you get paid for the tracked conversion, so the site's job is to get the right visitor to the right merchant with a code that works. Second, codes come from affiliate networks (which aggregate merchant programs), from direct merchant relationships, or from your own users, and each source has different reliability. Network feeds are structured but often stale. Direct deals pay better but take sales work. User-submitted codes are free and frequently wrong.
That means the database isn't a content library. It's a claims system: every code has a source, a status, an expiry, a last-verified time, and a success history. Build it that way and the rest of the project gets easier.
The prerequisites before you write a line of code
You need four things settled first, because they determine the schema.
Merchant access. Find out which affiliate networks accept publishers in your target country and niche. Some networks require a live site with traffic before approval, which creates a chicken-and-egg problem; the usual workaround is applying with a content plan and a partially built site, then joining networks whose approval is lighter. You cannot build a real voucher site without at least one network account, because you need live offer feeds to test against.
A legal footing. Coupon sites deal with affiliate disclosure rules, trademark use in merchant names, and consumer-protection rules about misleading offers. The specifics vary by country and change, so get a local read on disclosure requirements and terms of the networks you join rather than copying another site's footer.
A stack you can operate alone. A server-rendered web framework, a relational database, and a job scheduler for verification tasks will carry you a long way. Nothing about this project needs a distributed system on day one.
A definition of "working." Decide in advance what counts as a verified code: a successful test purchase, a merchant API check, a network feed flagged as active, or a user report. Every later feature depends on that definition.
Design the data model before any page exists
Most broken coupon sites are broken in the schema. The minimum viable set of tables looks like this:
merchants: id, name, slug, domain, logo, category, affiliate network, network merchant id, commission description, status. offers: id, merchant_id, title, description, landing URL, affiliate tracking URL, type (code, deal, printable), start and end timestamps, status, source. codes: id, offer_id, code string, normalized code, status (active, expired, invalid, unverified), first_seen, last_verified, last_success, success_count, failure_count, source. verifications: id, code_id, checked_at, method (api, manual, user_report), result, notes. clicks: id, code_id, session id, timestamp, country, device, outbound URL. categories and merchant_categories: for browse pages and internal linking. users and submissions: for crowdsourced codes, with rate limits and moderation state.
Two design choices matter more than the rest. Keep codes in their own table, separate from offers, because one offer can carry several codes over time and you want history rather than overwrites. And store a normalized version of each code (trimmed, case-folded, whitespace collapsed) alongside the display version, so duplicate detection and user reports match reliably.
Add indexes on offers.merchant_id, codes.offer_id, codes.status, codes.last_verified, and merchants.slug from the start. A voucher site's hottest queries are "active codes for merchant X, newest first" and "codes that haven't been checked in N days," and both should be index-only lookups.
If you also plan to show historical pricing or deal trends, resist the urge to add it now. A clean core schema with a verifications log can support that later; a messy core cannot.
Build the code lifecycle: states, expiry, and verification
This is the part that separates a usable site from a spam farm. A code moves through states, and your jobs move it:
1: Ingested. A code arrives from a network feed, a merchant, or a user. Store the raw source payload so you can debug later. 2: Unverified. It's live on the site only if you choose to show unverified codes; many sites do, with a visual distinction. 3: Verified. A check confirmed it works. Record the method and timestamp. 4: Expired. The end date passed or the merchant killed the offer. 5: Invalid. Checks failed repeatedly.
The verification job is the heart of it. If a network exposes a code-validation API, use it: you send the code and the merchant, it tells you whether the discount applies. If not, you fall back to scheduled manual checks, feed status flags, and user reports aggregated by threshold (for example, an active code flagged as broken by several independent users in a short window goes back to unverified automatically).
Schedule the verification job rather than trusting the feed. A nightly sweep that rechecks codes with upcoming expiry dates, plus a rolling check of the oldest-verified codes, keeps the site honest. The failure mode to avoid is a page that shows ten ancient codes with no verification dates; users learn it's noise within one visit.
A worked estimate helps size this. Suppose you carry 20,000 active codes and want each rechecked weekly. That's about 2,900 checks a day, or one every 30 seconds. If your network allows 60 API calls per minute, that fits comfortably inside one worker with rate limiting. If it allows 5 per minute, you need roughly 10 hours per day of checking and should prioritize high-traffic merchant pages first. Do the arithmetic for your own inventory before you assume a single cron job is enough.
Expect the check itself to fail sometimes: API timeouts, network rate limits, merchants that block automated traffic. Those aren't invalid codes, they're unknown results. Store them as such and retry with backoff, because marking a working code invalid is as damaging as leaving a dead one up.
Wire the affiliate tracking correctly
The money path is a redirect chain, and it deserves more care than the homepage. The pattern is: your code page has a "reveal code" or "get deal" button, which writes a click record and sends the user to your outbound endpoint, which appends your affiliate parameters to the merchant's landing URL and issues a redirect. On merchant pages, the click usually opens the merchant in a way that keeps your tracking intact.
Three practical rules:
Never hardcode affiliate parameters in the database per page. Build the outbound URL from the network's tracking template plus the merchant's destination URL, so a network changing its parameter format is one code change, not thousands of database rows. Record the click before the redirect. If you can't attribute revenue, you can't optimize anything, and click data is also how you detect broken redirects. Test the full chain in a staging environment with a real purchase. A redirect that loses the affiliate parameter looks identical to a working one until the commission statement arrives and shows nothing.
For cookies, affiliate tracking usually relies on a cookie set by the merchant or network at click time, so users clearing cookies or blocking third-party cookies can break attribution. That's outside your control, but it's why server-side click logs plus network-reported conversions are both worth keeping.
Build the public pages for users and search engines
The page types are predictable: a homepage with featured merchants and categories, category pages, merchant pages listing that merchant's codes, individual offer pages, a search results page, and a blog or buying-guide section. Merchant and offer pages carry the commercial intent; the guides carry the informational traffic that feeds them.
Render pages on the server. Coupon pages are mostly static content with a small interactive element (reveal code, copy to clipboard), and server rendering gives you fast first paint and clean HTML for crawlers without client-side hydration complexity.
A few layout choices that affect results:
Put the code and a clear expiration/verification status above the fold. Users came for one thing. Show the discount as a headline, not buried in a paragraph. "20% off first order" beats "Save on your next purchase." Make copy-to-clipboard the primary action, with the reveal as a fallback for codes that need it (some merchants require the click to register the affiliate). Include the merchant's terms summary and any exclusions, because misleading codes drive refunds and complaints. Write an original short description per merchant page. Duplicated manufacturer boilerplate is the most common reason these pages underperform.
On discoverability, the honest position is that coupon sites live or die on long-tail search for "merchant name + promo code" and on direct traffic from email and social. Search engines have historically treated thin, auto-generated coupon pages harshly, and the exact treatment changes, so the durable approach is to make each merchant page genuinely more useful than a bare code list: verification dates, known exclusions, alternatives when a code fails, and a clear way to report a broken code. Internal linking from category pages to merchant pages to individual offers spreads both users and crawlers through the site.
Handle user-submitted codes and fraud
User submissions are free content and a trust risk at the same time. Open submissions attract spam, referral-code spam disguised as discounts, and outright scams. Treat submissions as a moderation queue, not a publish action.
The controls that work: a required account or at least an email verification, rate limits per account and per IP, duplicate detection against the normalized code column, and a manual review step before a user code goes live. Track per-user accuracy: an account whose codes get reported broken repeatedly loses submission privileges automatically. Show the submitter's reliability on the code ("submitted by a user with 40 confirmed codes") if you want the crowd to help moderate.
There's a fraud angle on the merchant side too. Some codes in the wild are employee discounts, single-use codes, or codes that exist only to bait clicks. A code that works once and then fails is worse than no code, so testing new sources against real conversions before scaling them is worth the delay.
Model the business: traffic, conversion, and commission
The site is an affiliate business, so the arithmetic should be explicit. A simple model:
| Input | Illustrative value | Note |
|---|---|---|
| Monthly organic + social sessions | 50,000 | Depends entirely on content and merchant coverage |
| Click-through to merchant | 25% | Varies widely by page type |
| Merchant conversion rate | 3% | Merchant-controlled, not yours |
| Average order value | $60 | Category-dependent |
| Commission rate | 6% | Network-reported |
| Monthly revenue | $1,350 | 12,500 clicks × 0.03 × $60 × 0.06 |
That number is the reason most small voucher sites fail: at plausible traffic levels, the commission math is thin, and it collapses if the traffic is low-intent. The two levers are merchant coverage in high-commission categories and page quality that lifts click-through and conversion. A site with 200 merchants and 50,000 monthly sessions can be a real business; a site with 5,000 merchants and no traffic is a database.
Cash-flow reality matters too. Affiliate networks typically pay on a delay (often net-30 to net-90 after the merchant settles), and reversals happen when customers return items. Plan working capital for at least a quarter of revenue in transit, and don't spend on paid acquisition until you know your actual commission per click from your own conversion reports.
Deploy, monitor, and keep codes honest
Launch in a limited form: one category, a few dozen merchants, real verification data. The launch checklist is short but non-negotiable.
Prerequisites: staging environment with test affiliate parameters, search console set up, analytics with click events, error tracking, a scheduled job runner, and backups of the codes table.
1: Seed merchants and codes from one network feed, marking everything unverified. 2: Run the verification job manually once and review failures by hand to tune the rules. 3: Test the full redirect chain with a real purchase and confirm the conversion appears in the network's report. 4: Publish a small set of merchant pages with original descriptions. 5: Add the broken-code report button and wire it to the submission queue. 6: Turn on the nightly verification job and a dashboard showing active codes, codes checked in the last 24 hours, and broken-code reports.
Success check: after two weeks, look at the ratio of verified to total active codes and the share of clicks that reach the merchant's site without a redirect error. Both should be visible on one dashboard. If verified coverage is below roughly half, the source data is the problem, not the UI.
Stop condition: if network terms prohibit automated checking, or if a merchant's program forbids coupon-site traffic and you can't resolve it through the network, don't build workarounds. That's a legal and account-termination issue, and it needs the network's or a lawyer's guidance, not a clever script.
Ongoing, the work is mostly maintenance: prune merchants that stop paying, refresh top pages weekly, watch for redirect breakage after merchant site redesigns, and check that your disclosure and privacy pages match current requirements. The sites that last are the ones where someone is still checking codes a year after launch.
Where this usually goes wrong
Three failures account for most dead voucher sites. The first is showing unverified inventory at scale; it trains users to distrust the site and search engines to discount it. The second is ignoring the redirect and attribution layer until after launch, which produces traffic with no measurable revenue. The third is building for breadth first: 5,000 merchants with no original content and no verification beats nothing, but only barely, and it's much harder to fix than 100 merchants done properly. Start narrow, verify everything, measure the money path, and expand coverage only as fast as you can keep it honest.