Registering users with an invitation code in WordPress makes it easy to limit registration and provide exclusive access to specific users.
While WordPress doesn’t natively support invitation codes, you can add this functionality with plugins like User Registration.
In this guide, we’ll walk you through the steps to register users with invitation codes using User Registration.
Let’s jump right into it!
How to Register Users with an Invitation Code in WordPress?
Since WordPress doesn’t have the invitation code feature by default, you’ll need a plugin like User Registration.
Not only does it allow for custom registration pages, but its Invite Codes add-on also simplifies the process of registering users via invitation codes.
So, let’s get started.
1. Install the User Registration Pro Plugin
Before we start, we should point out that you can only register users with an invitation code with the premium version of User Registration.
You’ll need to buy a premium plan to access the Invite Codes add-on, which allows you to create and add invitation codes to your registration forms.
Go to User Registration’s official pricing page and buy a Plus plan or above. You must choose the Plus plan or Professional Plan since the Invite Codes add-on is only available in these plans.
Once you’ve bought a plan, you need to install and set up the pro plugin on your website. You can refer to our complete guide on how to install and set up User Registration properly.
2. Install and Activate the Invite Codes Extension
After you’ve installed User Registration Pro, open the Dashboard >> All Features tab on your WordPress dashboard.
You’ll end up on the same page if you navigate to User Registration >> Extensions.
Here, search for the Invite Codes add-on from the list of available features and add-ons. Simply Activate the add-on, and it’s ready for use.
3. Create the Invitation Codes
With the initial setup complete, your next step will be creating the invite codes. Otherwise, your users won’t have any code to register with.
To do that, go to User Registration >> Settings through your sidebar and click the Invite Codes tab.
This will take you to the Codes List page, where you can view, edit, and manage your invitation codes.
However, to manually create new user registration invitation codes, click on the Add New page. You’ll see a bunch of options that enable you to create a new invitation code.
To help you understand how it works, we’ve created a new code in the image above. The code we’ve added is SALE2024. It has a user limit of 12 unique users and expires on October 31, 2024.
- User Limit: Change the number of users who can use the same code. If you leave it empty, the code can be used infinite times.
- Expiry Date: Set the date as needed. Leaving it empty means that the invitation code will never expire.
- Select Form: Set the form for which the code will be valid. For now, the dropdown list only has the Default Form. However, that’ll change once we create a custom form later in this tutorial.
- Override User Role: Enable this option if you need to change the default user role for the selected registration form. Otherwise, disable it.
- User Role: Select the WordPress user role to assign to visitors who use the invitation code.
You can also generate multiple codes simultaneously instead of individually adding new invitation codes. To do that, click the Generate Random Codes tab under Invite Codes.
- Code Numbers: Set the number of codes to be created.
- Code Prefix: Add a prefix to all the generated codes to make them more distinct.
Like the manually generated codes, you can also set the user limits, expiry date, and permission provided by the code. As before, you’ll need to select the form for these codes as well.
Besides that, you’ll see a Raw List tab beside Generate Random Codes, where you can view the Code Details.
And with that, you’ve successfully created a valid invitation code for your registration form with the invitation code field.
4. Create a New Registration Form with Invitation Code Field
Of course, you first need a registration form for users to register on your website.
So, to create one, start by going to User Registration >> Add New.
Here, you can build a form from scratch or pick a template to customize. For this tutorial, let’s select Start from Scratch.
Give your form a name and press Continue.
As you can see, the form on the right already has four default fields: Username, User Email, User Password, and Confirm Password.
If you need more fields, drag and drop the ones you see on the left and add them to your form. Then, hit Publish form.
To add a field for invite codes, scroll down and find the Invitation Code field in the Extra Fields subsection.
When you click on it, you’re prompted to set up the invite code first to unlock the field. So, select Add Invite Code.
You’re returned to User Registration >> Settings >> Invite Codes. Here, Edit the code you previously created.
Then, select the current form in Select Form.
Save the changes and go back to the builder.
Now, drag the Invitation Code field to the desired form row. Your users must enter their invitation code into this field while registering.
After completing the form, hit the Update form button at the top of the form builder.
5. Customize the Invitation Code Field
Now, click on the Invitation Code field to bring up its Field Options. The field options have two settings: General and Advanced.
General Settings
By editing the Label, you can change what it says in place of ‘Invitation Code.’
From here, you can also add a Description for the field and change the Placeholder text.
Below, you’ll find another option to make the invitation code a Required field. Moreover, you can Hide the label entirely if you want.
You can also Enable Tooltip for the field and add the Tooltip Message.
Advanced Settings
The Advanced Settings allows you to add Custom Class to the field. You can also enable the field to be dynamically populated.
Similarly, you can customize the rest of the fields in the form per your requirements.
Finally, click the Update Form button on the top right.
6. Configure the Settings for Your Registration Form with Invitation Code
Next, configure the registration form settings on the Form Settings tab.
Under the General tab, you can configure the User Approval and Login Option, set Default User Role, Enable Strong Password, edit the Submit Button Text, and more.
Similarly, right below the General tab is the Extras tab. Here, you get to Enable Reset Button, Enable Form Field Icon, Activate Auto Generated Password, and so much more.
You can configure these settings, update the changes, and move on to your next step!
7. Insert the Form into Your Site
Once you’ve created a form with an invitation code field and some actual invitation codes, you’ll need to add the form to your site.
To do so, click on the Embed button at the builder’s top.
This opens a popup prompting you to select an existing page or create a new one to embed the form.
Let’s create a new page for this tutorial by clicking Create New Page.
Then, give the page a title and press the Let’s go! button.
This automatically creates the page and adds the form to it.
Finally, publish the page, and you’re done!
Once done, you can register users with invitation codes on your WordPress site.
8. Manage Your Invitation Codes
There’s one more thing left for you to do: manage your invitation codes.
Hence, go to User Registration >> Settings >> Invite Codes. You’ll see the Codes List page, where every code you’ve created will be listed.
From here, you can check their creation and expiry date, whether they’re active or not, their user role, and the user count for each of the codes.
You can even edit or delete the existing invite codes from here.
Additionally, go to Users >> All Users to see the current list of users, their roles, and the invite code they used.
From there, you can easily track which invite codes were used by which user.
Put this Guide into Action
This ends our easy guide on registering users with invitation codes in WordPress.
So, what are your thoughts on it? Comment below.
We have more articles like this on our blog, detailing all of the ways you can use User Registration for your site.
For instance, check out our guides on how to add extra fields to WooCommerce registration forms and how to enable admin approval for them.