Contact Form 7 OTP verification makes a visitor confirm their mobile number with a one-time password (OTP) sent by SMS before the form can be submitted. You switch it on by adding the SMS ALERT PHONE field to your form and enabling its OTP option. The SMS Alert WordPress plugin then adds a verification step next to the number field and blocks submission until the OTP is entered correctly.
New to the plugin? Install it and connect your account with the WordPress SMS plugin setup guide.
Before you start
- Install and activate Contact Form 7, the SMS Alert plugin and connect your SMS Alert account.
- Keep SMS credits in your account. Every OTP, including a resend, uses credits.
- On India routes, the OTP message must match an approved DLT template. See Convert into DLT Template.
How to add OTP verification to a Contact Form 7 form
- In the WordPress dashboard, open Contact Form 7 and edit the form where you want OTP verification.
- In the tag generator, choose the SMS ALERT PHONE field (labelled “SMS Alert Phone” in newer versions of Contact Form 7). Its default name is
billing_phone. - Tick “Use this field for sending OTP to Mobile Number”. This is the option the plugin calls “use this field to send OTP”.
- Insert the tag into the form and click Save.
- Open the SMS Alert tab of the same form. In the Visitor SMS Notifications section, select the SMS ALERT PHONE field as the visitor’s mobile number field.
- Click Save.
Once saved, submissions of this form are verified by OTP.
What the visitor sees
- The visitor enters their mobile number in the SMS ALERT PHONE field and fills in the rest of the form.
- The visitor starts verification (the plugin adds a verify step next to the field) and an OTP is sent by SMS.
- The visitor enters the OTP. On success they see “OTP Validated Successfully.”
- The visitor submits the form.
If the visitor submits without verifying, the number field shows “Your mobile number is not verified yet. Please verify your mobile number.” and the form is not sent. A wrong code shows “Invalid one time passcode. Please enter a valid passcode.” A missing number shows “Please enter phone number.” An invalid number shows an invalid number format message.
Verification counts for one submission. The next time the visitor submits the form, they verify again.
Troubleshooting
Problem | What to check |
|---|---|
The form is submitted without an OTP | Check that you used the SMS ALERT PHONE field and ticked “Use this field for sending OTP to Mobile Number”. Check that the same field is selected as the visitor number in the SMS Alert tab and that the country code is accepted. |
The SMS ALERT PHONE field is missing from the tag generator | The SMS Alert plugin or Contact Form 7 is not active, or your SMS Alert account is not connected. |
No OTP arrives | Check your SMS credits, the mobile number format, the sender ID, DLT template approval and the delivery report in your SMS Alert account. See Unable to Send OTP from WordPress Plugin. |
“Invalid one time passcode” appears | The code was entered wrongly or has expired. Ask the visitor to request a new OTP. |
The visitor must verify every time | Verification applies to one submission only, by design. |
The OTP message is rejected on India routes | The text does not match your approved DLT template. See Template Mismatch Error. |
The form is not a Contact Form 7 form | Use the OTP Verification shortcode instead. See SMS Alert shortcodes. |
Frequently asked questions
What does OTP verification for Contact Form 7 do?
It makes visitors confirm their mobile number with an OTP before the form can be submitted.
How do I turn it on?
Add the SMS ALERT PHONE field to the form, tick “Use this field for sending OTP to Mobile Number” and save.
What is the field called?
SMS ALERT PHONE in the tag generator. Its default name is billing_phone.
Does the visitor verify every time they submit?
Yes. Each submission needs a fresh verification.
What happens if the visitor does not verify?
The form is not sent, and the number field shows a message asking them to verify.
Can I also send an SMS notification from the same form?
Yes. See Contact Form 7 SMS notifications.
What if my form is not built with Contact Form 7?
Use the OTP Verification shortcode. See SMS Alert shortcodes.
Do I need DLT registration?
On India routes, yes. The OTP text must match an approved template.
Does it use SMS credits?
Yes, for every OTP including resends.
