Chúc mừng Tết Trung Thu 15% off everything Shop the sale
Unique Field guides
Beginner Unique Field

Make a custom field unique with Unique Field

Stop two members, or two threads, from using the same value in a custom field. Where the setting lives and how the duplicate rules work.

Updated 3 min read By the D.C Style team

On this page

Unique Field stops two members, or two threads, from using the same value in a custom field. It suits things like a game character name, a licence plate, a membership number or a product serial, anything that should belong to one member or one thread only. There are no options pages and no permissions: the settings sit on each custom field's own edit page. It works on XenForo 2.2 and newer.

Which fields it works with

Unique Field adds its settings to XenForo's two kinds of custom field:

  • Custom user fields, in Users > Custom user fields. These appear on registration, account details or profiles, depending on how the field is set up.
  • Custom thread fields, in Forums > Custom thread fields. These appear when starting a thread in the forums you choose.

Fields from other add-ons, such as resource or media fields, are not covered.

Make a field unique

  1. Go to Users > Custom user fields (or Forums > Custom thread fields) and click the field.
  2. Tick Field is unique. From now on, any new value entered in this field must not already be used by another member or thread.
  3. Optionally, fill in the three settings below, then save.

When someone enters a value that is already taken, they see "Please enter a unique value for this field. Another content has already had this field value." and can try again.

Allow some values to repeat

Three settings loosen the rule where you need to:

SettingWhat it does
Field allowed duplicated valuesA comma-separated list of values anyone may reuse, for example none, n/a. Only for text and single-choice fields.
Field maximum duplicated charactersHow many characters a new value may share with an existing one. Enter 0 to reject only whole values that match exactly. Only for text and single-choice fields.
Field maxium duplicated timesHow many times the same value may be used before it is refused.

If you set a character limit, the duplicated-times setting is not used. For most fields, tick Field is unique, leave maximum duplicated characters at 0, and add any "empty" answers such as none to the allowed values. Only use the character limit if you understand you are asking for values that are not merely different, but different enough.

Tip: Test the field yourself before announcing it. Create a test member or thread, enter a value, then try the same value again with a second test account.

What it does not do

  • Existing values are not checked. Values entered before you ticked Field is unique stay as they are, even if two members already share one. The rule applies from the next time a value is entered or changed.
  • Whole values are compared. Unless you set a character limit, Blue Car and Blue Car 2 are different values, so both are accepted. If near-matches matter, make the field a choice list rather than free text, or tell members the exact format you expect.
  • Only visible content counts. Values on deleted or moderated threads, and on accounts that are not yet confirmed, do not block a new one.

Removing it

Uninstalling Unique Field removes its settings from your custom fields, but the values members entered stay in their fields. Disable or uninstall an add-on explains the difference between switching it off and removing it.

New to custom fields and where they appear? Where to find an add-on's settings is a good place to start. More on the Unique Field page.

Still stuck? Open a support ticket with your XenForo version, the field's name and type, and the two values you expected to be treated as duplicates.

Did this guide help? Thanks! Glad it worked. Sorry about that. What went wrong? Thanks for telling us. We'll use it to improve this guide.

What went wrong?
Need a reply? Open a Unique Field ticket instead.

Unique Field

v1.0.2 Patch Level 1 · Free

Download free Product page → Ask about Unique Field →