Adding a WP SMS Subscriber Form in WordPress

Updated on Jan 19, 2023

In this document, we will show you how to easily add a WP SMS subscriber form to your WordPress website. This form can be used to collect your visitors’ mobile numbers, allowing you to keep them informed and updated through SMS notifications and alerts.

There are four ways to add the WP SMS subscriber form to your website

Add the SMS Newsletter through the Gutenberg block

  • Create a new Post or Page in the admin
  • Click the Add Block button.
  • Select the WP SMS widget and add it in the appropriate place.
  • Add the title and description of the form.
  • Click the Publish or Update button.

Add the SMS Newsletter through the Widgets

  • Go to Appearance → Widgets.
  • Choose where you want the widget to appear on the site.
  • Click the Add Block button.
  • Select the WP SMS widget.
  • Finally, click on the update button.

Add the SMS Newsletter through the Shortcode

  • Create a new Post or Page in the admin
  • Insert shortcode [wp_sms_subscriber_form title=”SMS Newsletter” description=””]
  • Click the Publish or Update button.

Please keep in mind the shortcodes also support the custom fields which means you can add your custom fields in the SMS newsletter form. like

[wp_sms_subscriber_form title="SMS Newsletter" description="" fields="age:Enter Your Age|country:Enter Your Country"]

Add the SMS Newsletter through the PHP function

You can also load the SMS newsletter form with the PHP function in your theme or plugin.

wp_sms_subscriber_form([
    'title' => 'SMS Newsletter form',
    'description' => 'Subscribe to our SMS newsletter to get the latest news and updates delivered directly to your phone.',
]);

You can also add your custom fields in the form with this function like

wp_sms_subscriber_form([
    'title' => 'SMS Newsletter form',
    'description' => 'Subscribe to our SMS newsletter to get the latest news and updates delivered directly to your phone.',
    'fields' => [
        'age' => [
            'label' => 'Age',
            'description' => 'Please enter your age',
            'type' => 'number',
        ],
        'country' => [
            'label' => 'Country',
            'description' => 'Please enter your country',
            'type' => 'text',
        ],
    ]
]);