How to Add SMS OTP Verification to WordPress Forms
A phone field can reject an incomplete number. It cannot confirm that the visitor can receive a message at that number.
SMS OTP verification adds that check before WordPress accepts the form. The visitor receives a temporary code by text and enters it to continue.
In this guide, you will create an Event Registration Phone Verification form with FormGent. You will connect an SMS provider, map the phone field, review the verification settings, test the public form, and check the result in WordPress.
Quick answer: Create or open a FormGent form, add a required Phone Number field, configure an SMS gateway, and open Form Settings → OTP Verification. Enable verification, choose Phone (SMS), map the phone field, save the settings, and submit the public form with a phone number you can access.
What is SMS OTP verification in a WordPress form?
OTP means one-time password. It is a temporary code that can be used once during a verification attempt.
The process has three parts:
- FormGent collects the phone number and controls the form submission.
- The SMS gateway delivers the code.
- The visitor enters the code to confirm access to the phone number.
This confirms that the visitor can receive a message at that number. It does not confirm the person’s full identity.
Phone validation, SMS OTP, and SMS notifications are different
These features solve different problems:
| Method | What it does | When it happens | Confirms access to the number? |
| Phone validation | Checks whether the number follows an expected format | While completing or submitting the form | No |
| SMS OTP verification | Sends a temporary code that the visitor must enter | Before the submission is accepted | Yes |
| SMS notification | Sends a confirmation or alert | After a form event or submission | No |
Use this guide when you need verification before accepting the form. If you want to send an alert after submission, follow the separate SMS notification workflow instead.
When should you add phone OTP to a form?
SMS OTP is useful when your next action depends on a reachable phone number.
Common examples include:
- Event registration forms that send attendee updates
- Appointment and booking forms
- Quote requests that require a phone call
- High-intent sales inquiries
- Registration forms that depend on phone communication
The extra verification step is not necessary for every form. Keep the form simpler when the phone number is optional, email is your main contact method, or another protection method already fits the risk.
What you need before you start
Prepare these items:
- Access to the WordPress dashboard
- An editable FormGent form
- A Phone Number field in the form
- Access to FormGent → Settings → SMS Gateway
- An account with an SMS provider
- A sender or provider setup that can deliver messages to the target country
- A phone number you can use for the final test
What does the SMS gateway do?
FormGent manages the code and the verification step. The gateway sends the text message to the visitor.
Without a working gateway, the form cannot deliver the SMS code. Provider charges, trial limits, or sender requirements may apply. Review the complete guide to configure an SMS gateway before testing the form.
Which FormGent SMS provider should you choose?
FormGent provides three options:
| Provider | When it may fit | What you need |
| Twilio | You want a dedicated messaging service or already use Twilio | Account SID, Auth Token, and a usable From Phone Number |
| Firebase (Google) | Your site already uses Firebase or you prefer Firebase phone authentication | Firebase project, phone authentication, authorized domain, API details, and billing |
| Custom Gateway | You use another SMS service with an HTTP endpoint | Endpoint, request method, authentication, message body, and success response details |
If you use a Twilio sender for US recipients, check Twilio’s current US messaging requirements. The required setup depends on the sender and messaging route.
This walkthrough focuses on the FormGent settings. Follow your provider’s current instructions when creating the external account or sender.
How to add SMS OTP verification to a WordPress form
The steps below use a form named Event Registration Phone Verification.
Step 1: Create or open the event registration form
- Open the WordPress dashboard.
- Go to FormGent → All Forms.
- Open Event Registration Phone Verification.
If the form does not exist, select Create New, start with a blank form, and use that name.

The clear name will help you find its submissions later. If this is your first form, follow the guide to create your first FormGent form.
Step 2: Add the event registration fields
Add these fields in order:
- Name
- Phone Number
Select the Phone Number field and change its label to Mobile Number. This label tells visitors exactly what to enter.
Keep the example focused. You can add event choices or attendance details after the phone-verification workflow is working.

Step 3: Make Mobile Number required
- Select the Mobile Number field.
- Open its field settings.
- Turn on Required.
A blank field cannot receive a code. However, making the field required only prevents an empty answer. The OTP step confirms access to the number.
Mobile Number is required, as shown by the red asterisk.

Step 4: Open the SMS Gateway settings
Open another browser tab so you do not lose the form editor.
- Go to FormGent → Settings.
- Select SMS Gateway.
- Open the SMS Provider dropdown.
Choose the provider you plan to use.

Step 5: Configure the SMS provider
The fields change when you choose a provider.
For Twilio, enter:
- Account SID
- Auth Token
- From Phone Number
Then select Save Changes.
Keep the Auth Token private. Do not place it inside the form, an article image, or a public page.

For Firebase or Custom Gateway, complete the fields shown for that provider. The FormGent SMS Gateway documentation explains each provider path.
Step 6: Open OTP Verification in Form Settings
Return to the Event Registration Phone Verification form.
- Open Form Settings.
- Select OTP Verification.
- Turn on Enable OTP verification.
OTP Verification is a form-level setting. Enabling it here affects this form, not every FormGent form on the website.

Step 7: Choose Phone (SMS) and map Mobile Number
- Select Phone (SMS) as the verification type.
- Find the matching-field setting.
- Confirm that Mobile Number is selected.
When there is only one compatible phone field, FormGent selects it automatically. If the form has no compatible field, add a Phone Number field and reopen OTP Verification.
The interface also states that verification happens when the visitor submits the form.

You can review the official FormGent OTP verification settings if you need a reference for every option.
Step 8: Review expiry, attempts, and resend delay
The walkthrough uses these default values:
| Setting | Value | What it controls |
| OTP expiry | 5 minutes | How long the code remains valid |
| Maximum attempts | 5 | How many wrong-code entries are allowed |
| Resend cooldown | 45 seconds | How soon another code can be requested |
These values are a sensible starting point for an event registration form. Avoid making the expiry so short that visitors cannot read and enter the message.

Step 9: Review the SMS text and visitor messages
The SMS template supports two tags:
- {{otp}} adds the verification code.
- {{expiry}} adds the expiry time in minutes.
The default text is clear and short:
Your code is {{otp}}. It expires in {{expiry}} minutes.
Keep both tags in the message. The visitor needs the code and should know how quickly to use it.
Also review these visitor messages:
- OTP Sent
- Prompt
- Invalid OTP
- Expired OTP
Use short instructions. For example, an expired-code message should tell the visitor to request a new code.

Step 10: Save the settings and publish the form
- Save the OTP settings.
- Save the form.
- Publish the form if it is still a draft.
- Open the page where you published the form.


Do not stop after saving the dashboard settings. A public test is the only way to confirm that the form and SMS provider can work together.
Test the SMS OTP workflow from the visitor side
Use a private browser window or log out of WordPress. This shows the form as a normal visitor would see it.
Fill in and submit the public form
- Open the published Event Registration page.
- Enter a name and email address.
- Enter a phone number that you control.
- Include the correct country code when required by the provider.
- Select Submit.

Enter the verification code
After the provider sends the message:
- Open the SMS on the test phone.
- Enter the newest code in the OTP prompt.
- Complete the verification.
- Confirm that the form shows its normal success result.
The OTP prompt appears after the connected SMS provider accepts the message request. Use a phone number you can access so you can enter the newest code.
If the code does not arrive, do not repeatedly submit the form. Check the provider account, sender status, phone format, and delivery information first.
Confirm the entry in WordPress
After the form is completed:
- Return to the WordPress dashboard.
- Go to FormGent → Entries.
- Find Event Registration Phone Verification.
- Open the latest completed entry.
- Check that the submitted details match the public form.
The Entries check confirms that the visitor-facing process finished and WordPress saved the response. The FormGent Entries guide explains the full response-management screen.
What happens when the OTP cannot be sent?
If the gateway is missing or cannot send the request, the visitor may see:
Failed to send OTP. Please try again.
In this state, the visitor remains on the form. The failed attempt does not appear as a new completed entry in FormGent Entries.
This is why the public test matters. Saving the form does not confirm that the external SMS service can deliver a code.
Troubleshoot common SMS OTP problems
Use this table to decide what to check next.
| Problem | Likely cause | What to check next |
| FormGent cannot find a phone field | The form has no compatible Phone Number field | Add the field, save the form, and reopen OTP Verification |
| “Failed to send OTP” appears | The gateway is missing, incomplete, or rejected the request | Check the provider, credentials, sender, and provider logs |
| The code does not arrive | Phone format, sender status, provider account, carrier, or regional issue | Confirm the country code, provider status, account limits, and delivery log |
| The code is rejected | The code is wrong, old, or no longer valid | Enter the newest code carefully and request another when allowed |
| Resend is unavailable | The resend cooldown is still active | Wait for the configured delay |
| No entry appears in WordPress | Verification or submission did not finish | Complete the public workflow, then check Entries again |
Check Twilio restrictions
A Twilio trial account or an unready sender may not deliver the test message. Review the current Twilio trial and US Toll-Free limitations.
Check Firebase settings
For Firebase, confirm that phone authentication is enabled, billing is connected, and the website domain is authorized. Google also explains regional and delivery issues in its Firebase Authentication troubleshooting guide.
Check the phone number format
Include the country code when your provider requires international format. A valid-looking local number may still fail if the gateway expects the full country code.
Check the provider log
The provider dashboard can show whether it received the request, rejected it, or passed it to the carrier. This is often the best next check when FormGent is configured but the phone receives nothing.
SMS OTP best practices for a smoother form
Require verification only when the phone number matters
OTP adds another action for the visitor. Use it when a reachable number is important for registration, scheduling, follow-up, or account access.
Use a clear phone-field label
Use Mobile Number or Phone Number. Avoid labels that could mean several things, such as “Contact.”
Keep the SMS message short
Include the code, expiry time, and enough context to identify the website or action. Remove unrelated promotional text.
Protect provider credentials
Do not share account secrets in screenshots, support messages, public documentation, or form fields.
Use OTP with other form protection
SMS OTP confirms access to a phone number. It does not stop every automated or abusive request. Use suitable validation, request limits, and spam protection for the form’s risk level.
Explain external processing
The configured SMS provider receives the phone number so it can deliver the code. Make sure your site’s privacy information explains the services used to process form data.
What is SMS OTP verification in a WordPress form?
It sends a temporary code to the phone number entered in the form. The visitor enters that code before the form submission can finish.
Is SMS OTP the same as an SMS notification?
No. SMS OTP checks access to a phone number before the form is accepted. An SMS notification usually sends information after a form event or completed submission.
Do I need an SMS provider?
Yes. FormGent manages the verification flow, but the configured SMS gateway delivers the text message.
Which SMS gateways can I connect to FormGent?
The available options are Twilio, Firebase (Google), and Custom Gateway.
Why is Phone (SMS) not finding my field?
Add a Phone Number field to the form and save it. Then reopen OTP Verification and map that field.
Why did the OTP fail to send?
Check the selected provider, credentials, sender status, phone-number format, trial restrictions, and provider delivery log.
What happens when the code expires?
The expiry setting controls how long the code remains valid. After that time, the visitor needs a new code.
Does SMS OTP stop all form spam?
No. It confirms access to the destination phone number. Use it with the validation and spam protection appropriate for the form.
Where can I check the form submission?
Go to FormGent → Entries after the visitor completes verification and submits the form.
Can I use email OTP instead?
Yes. Select Email as the verification type and map an Email field. Your WordPress website must be able to send email reliably.
Verify phone numbers before you depend on them
A useful SMS OTP workflow needs three connected pieces: a phone field, a working SMS gateway, and the correct OTP settings.
Build the form first, map the Mobile Number field, and review the expiry and resend settings. Then test it from the public page and confirm the completed result in FormGent Entries.
Once this workflow is ready, you can apply the same approach to bookings, event registrations, quote requests, and other forms where a reachable phone number matters. FormGent keeps the form, verification settings, and responses inside the same WordPress workflow.
Leave a Reply