Skip to content

Referral codes: create, limit and switch off codes

Describes Referrals 0.8.0.

A referral code is something new users enter when they register, or carry in through a referral link. Each code can be limited to a number of uses and an expiry date, and can name the user it was made for.

Where to find it

In the admin sidebar, open Referrals, then Codes (/admin/referral-codes/codes). You need the Referrals permission.

The Referrals module must be enabled on the Modules page. While it is off, the page shows Referrals Disabled with a Go to Modules button, and the status line says Disabled.

The Referrals list: totals, status Enabled and registration Optional, no referrals yet, and New Referral The Referrals list: totals, status Enabled and registration Optional, no referrals yet, and New Referral

Referral codes.

The codes list

At the top are the same four counters as on the Overview page. Under them, the Status card shows whether referrals are Enabled, and whether a code is Required or Optional at registration (set on the Referrals settings page). New Referral opens the form.

The table lists every code:

  • Code and Description.
  • Usage: uses so far out of the maximum, with a bar.
  • Expiration: the expiry date, or Never.
  • Status: Expired when the code has passed its date or reached its maximum uses, otherwise Active.
  • Created By: the admin who made it.
  • Beneficiary: the user the code was made for, or None.

With no codes yet, the page shows No Referrals and Create First Referral.

Row actions

  • The pencil opens the edit form.
  • Deactivate / Activate: switches the code off or on. A switched-off code can’t be used at registration.
  • The bin deletes the code after Are you sure you want to delete this referral?

Note that the Status badge doesn’t show whether a code is switched off: a deactivated code that hasn’t expired still reads Active. Check the button: it says Activate for a code that is off.

Creating or editing a code

The New Referral form: code with Generate, description, beneficiary user, maximum uses, expiration date and Is active The New Referral form: code with Generate, description, beneficiary user, maximum uses, expiration date and Is active

A new referral code.

  • **Code ***: type a code, or click Generate for a random five-character one (capital letters and digits, without look-alikes such as 0 and O). Codes are saved in capitals, must be 3 to 50 characters long and must be unique.
  • **Description ***: a note for yourself, such as who the code was handed to.
  • Beneficiary User: optional. Type at least two characters of an email, username or name and pick the user from the results. The cross clears the choice.
  • **Maximum Uses ***: how many people can register with the code. It can’t be higher than Maximum Uses Per Referral on the settings page, and a new code starts at that value.
  • Expiration Date: leave it empty for no expiry. It must be in the future.
  • Is active?: an inactive code can’t be used for registration.

Create Referral (or Update Referral) saves and returns to the list; the button stays disabled while the form has errors. Cancel goes back without saving.

Each admin can create only as many codes as Maximum Referrals Per User allows (10 by default). Past that, saving fails with a message naming the limit.

When a code is used

A code is used once per person: the same account can’t use one code twice. Using it adds one to its usage, and the sign-up shows up on the Overview page. A code that is switched off, expired or used up is refused.

What it doesn’t do

  • There are no rewards, credits or payouts for the beneficiary.
  • There is no search, sort or filter on the list.
  • It doesn’t show who used a particular code; the Overview’s Recent Activity lists only the ten latest uses overall.