Registering a user is the process in which a visitor creates an account on your website. The reasons why you may be interested in registering a user are diverse, including, for example, to save the data of your recurring customers, to join as a member of a forum, to join an affiliation or membership program, or to register as a collaborator or author of your website, among others.
By default, WordPress allows you to easily create user registration by indicating in Settings » General that anyone can register with a default profile for new users.
Thus, by providing the registration URL,
https://my-website/wp-login.php?action=register will display the following page for a user to register.
The problem with the default WordPress user registration is that, on the one hand, it does not allow you to add additional information about the user and, on the other, that the appearance of the page probably has little to do with your site’s look and feel.
The easiest way to solve both problems is to create a custom registration form in your WordPress that includes all the information you need and, in addition, is fully integrated with the style of the theme you use. Here are the steps to follow to create this type of forms with the Nelio Forms plugin. You will see how easy it is!
The Nelio Forms Plugin
Nelio Forms is a plugin for creating forms that integrates into the WordPress block editor with all the advantages that this entails. You can download the free version directly from the WordPress Plugin Directory and create all the simple forms you want. Or, if you want to unlock all its potential, you can get the Premium version for €49 and benefit from features like spam protection and data logging.
Create Your First Registration Form
Once installed from your Dashboard, creating a form is as easy as creating any post or page. In the sidebar menu, click on the “Add New” option from the Nelio Forms menu.
You will be taken to the block editor where you will create your registration form. Here you must define the form itself:
As you can see in the image above, you have a set of blocks that you can include as fields in the form by simply clicking and dragging, like any other block. You can indicate whether or not the fields are required, if you want the field label to be displayed, and add a placeholder if applicable. Also, you can add columns and text.
Create the Form’s User Registration Action
You currently have the following form submission actions:
- Entry recording,
- Email notification,
- User registration, and
- Content creation.
If you enable the Entry recording option, the information filled in the form will be saved in your WordPress database. Email notification will send an email with the submitted form fields to the provided email address(es). And the fourth option, Content creation, is used to create a post, page or custom content type with the information filled in the form.
In order to register a user in your database, you must enable the User registration option in the Nelio Forms plugin. A modal window will open with the default values that will be saved from the form in your database.
Review each of the fields and modify the value of each of them as you see fit. To do this, just click on the label icon to the right of the field and you will be able to select any of the form fields provided in a submission.
For instance, I can select the user’s email address and use it as the “username” of the user that’ll be created when the form is submitted.
In the advanced settings options you can indicate if you want the user to log in once the registration is completed. You can also specify whether you want a random password to be generated or, as in this example, to use the password the user entered when filling in the form as the registration password.
With Nelio Forms, you can also specify in the user registration form the value of the URL of the website and, through a drop-down, select the user role with which to register.
Finally, you can add in the form the additional meta-fields that you want to be saved from the user in the database of your website to complete the registration. This can be very useful to save additional information such as the telephone number, address, age, or any other information about your user.
As you can see, you have a wide variety of data options to register users in your database.
Insert Your Form Where You Want it to be Displayed
Once you have created your form, all that remains is to insert it on the page (or pages) where you want it to be displayed. The great advantage of Nelio Forms it its full integration with the WordPress editor. That is, you’ll be able to insert the form as a regular block as well as edit it inline.
Then you then have the option to create the form directly here. In this case, you can follow the steps explained above, or select the previously created form.
Once the form is selected, you already have it inserted in your page like any other block.
As I was saying, you can modify the form directly in the page where it’s used. If you do so, you will see that the button to update the page is slightly different and shows a white dot to the left of “Update.” When you update the page, you will need to confirm if you want to save the changes made to both the page and the form:
As you can see, it is much more convenient to make changes to the appearance directly on the page where you insert the form than if you had inserted it using, for example, a shortcode.
Check the Registered Users in Your WordPress
Once the registration form is already added to your page, you can check that the information added by your users is registered in the
wp_usermeta tables in your database and view the details in the users tab of your WordPress.
For this example, I have used the Pods plugin to add the display of the meta fields added in the form to the users tab.
We have seen that, to create a custom user registration form with Nelio Forms, you don’t need to know how to code—it’s as easy as creating a post or page on your website! You can add the fields you want in the form and adding it to any page is as easy as adding any other block, being fully integrated with the styles of your website.