BLACK FRIDAY

Get up to 60% OFF on FormGent Pro yearly & lifetime plans

Claim Deal
sms otp verification

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:

MethodWhat it doesWhen it happensConfirms access to the number?
Phone validationChecks whether the number follows an expected formatWhile completing or submitting the formNo
SMS OTP verificationSends a temporary code that the visitor must enterBefore the submission is acceptedYes
SMS notificationSends a confirmation or alertAfter a form event or submissionNo

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:

ProviderWhen it may fitWhat you need
TwilioYou want a dedicated messaging service or already use TwilioAccount SID, Auth Token, and a usable From Phone Number
Firebase (Google)Your site already uses Firebase or you prefer Firebase phone authenticationFirebase project, phone authentication, authorized domain, API details, and billing
Custom GatewayYou use another SMS service with an HTTP endpointEndpoint, 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

  1. Open the WordPress dashboard.
  2. Go to FormGent → All Forms.
  3. Open Event Registration Phone Verification.

If the form does not exist, select Create New, start with a blank form, and use that name.

01 open event registration form annotated

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:

  1. Name
  2. Email
  3. 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.

02 add event registration fields annotated

Step 3: Make Mobile Number required

  1. Select the Mobile Number field.
  2. Open its field settings.
  3. 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.

03 mobile number required annotated

Step 4: Open the SMS Gateway settings

Open another browser tab so you do not lose the form editor.

  1. Go to FormGent → Settings.
  2. Select SMS Gateway.
  3. Open the SMS Provider dropdown.

Choose the provider you plan to use.

04 open sms gateway annotated

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.

05 configure sms provider annotated

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.

  1. Open Form Settings.
  2. Select OTP Verification.
  3. 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.

06 open otp verification annotated

Step 7: Choose Phone (SMS) and map Mobile Number

  1. Select Phone (SMS) as the verification type.
  2. Find the matching-field setting.
  3. 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.

07 enable phone sms map field annotated

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:

SettingValueWhat it controls
OTP expiry5 minutesHow long the code remains valid
Maximum attempts5How many wrong-code entries are allowed
Resend cooldown45 secondsHow 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.

08 review otp limits annotated

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.

09 review sms template annotated 1

Step 10: Save the settings and publish the form

  1. Save the OTP settings.
  2. Save the form.
  3. Publish the form if it is still a draft.
  4. Open the page where you published the form.
10a save otp settings annotated
10b confirm form published annotated

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

  1. Open the published Event Registration page.
  2. Enter a name and email address.
  3. Enter a phone number that you control.
  4. Include the correct country code when required by the provider.
  5. Select Submit.
sms otp verification

Enter the verification code

After the provider sends the message:

  1. Open the SMS on the test phone.
  2. Enter the newest code in the OTP prompt.
  3. Complete the verification.
  4. 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:

  1. Return to the WordPress dashboard.
  2. Go to FormGent → Entries.
  3. Find Event Registration Phone Verification.
  4. Open the latest completed entry.
  5. 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.

ProblemLikely causeWhat to check next
FormGent cannot find a phone fieldThe form has no compatible Phone Number fieldAdd the field, save the form, and reopen OTP Verification
“Failed to send OTP” appearsThe gateway is missing, incomplete, or rejected the requestCheck the provider, credentials, sender, and provider logs
The code does not arrivePhone format, sender status, provider account, carrier, or regional issueConfirm the country code, provider status, account limits, and delivery log
The code is rejectedThe code is wrong, old, or no longer validEnter the newest code carefully and request another when allowed
Resend is unavailableThe resend cooldown is still activeWait for the configured delay
No entry appears in WordPressVerification or submission did not finishComplete 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

Your email address will not be published. Required fields are marked *