You can show a Contact Form 7 form with OTP verification in your site’s footer, so visitors on any page can verify their mobile number by SMS and send the form. You do this in two parts: add the SMS ALERT PHONE field to the form, then paste the form’s shortcode into a Custom HTML widget in the footer widget area.
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 resends, uses credits.
- On India routes, the OTP message must match an approved DLT template. See Convert into DLT Template.
- Your theme must have a footer widget area. See the note on block themes below.
Part 1: Build the OTP form
- In the WordPress dashboard, open Contact Form 7 and edit the form you want in the footer.
- In the tag generator, insert the SMS ALERT PHONE field (labelled “SMS Alert Phone”).
- Tick “Use this field for sending OTP to Mobile Number”.
- Click Save, then copy the form’s shortcode shown at the top of the form editor.
For the full OTP setup, see Contact Form 7 OTP verification.
Part 2: Add the form to the footer
- In the WordPress dashboard, go to Appearance, then Widgets.
- In the footer widget area, add a Custom HTML widget.
- Paste the Contact Form 7 shortcode into the footer widget.
- Click Update to save and view the form in your footer.
To test, open any page of your site in a private window, enter a mobile number in the footer form, verify the OTP and submit.
Block themes
Block themes (also called full site editing themes) do not have an Appearance, Widgets screen. In that case, open Appearance, then Editor, edit the footer template part and add a Shortcode or Custom HTML block with the form shortcode.
Limit OTP abuse on a public footer form
A footer form is visible on every page, so anyone, including automated bots, can request OTP SMS from it, and each SMS uses credits. To reduce this:
- Keep the OTP resend limit low. By default an OTP can be resent 5 times; you can change it with the
retryattribute on the OTP tag. See WooCommerce OTP verification. - Add a CAPTCHA to the form. See reCaptcha for forms.
- Watch your SMS delivery report for unusual spikes.
Troubleshooting
Problem | What to check |
|---|---|
The shortcode appears as text in the footer | The widget is not a Custom HTML widget, or the theme does not process shortcodes in that area. Use a Shortcode block or widget. |
The footer form has no OTP step | Check that the form uses the SMS ALERT PHONE field with the OTP option ticked, and that you pasted the shortcode of the saved form. |
No OTP arrives | Check credits, the mobile number format, the sender ID, DLT approval and the delivery report. See Unable to Send OTP from WordPress Plugin. |
OTP attaches to the wrong form | The footer form and another form on the page may both use the SMS Alert phone field. Test with one such form per page. |
The footer form is not updated | Clear your page cache after editing the form or widget. |
The OTP is rejected on India routes | The text does not match your approved DLT template. See Template Mismatch Error. |
Frequently asked questions
How do I add a Contact Form 7 form with OTP to my footer?
Add the SMS ALERT PHONE field with the OTP option to the form, copy its shortcode and paste it into a Custom HTML widget in the footer widget area.
Where is the footer widget area?
Under Appearance, then Widgets, in classic themes. Block themes use the Site Editor.
Do visitors verify every time?
Yes. Each submission needs a fresh OTP verification.
Can I put the same form in the footer and on a page?
Yes, same form can be used multiple times in a page.
Does it use SMS credits?
Yes, for every OTP.
How do I stop bots from triggering OTP SMS?
Add a CAPTCHA, lower the resend limit and watch your delivery report.
