Title: HantarSMS – OTP &amp; Marketing SMS for Malaysia
Author: HantarSMS
Published: <strong>October 23, 2026</strong>
Last modified: October 23, 2026

---

Search plugins

![](https://ps.w.org/hantarsms/assets/banner-772x250.png?rev=3762390)

![](https://ps.w.org/hantarsms/assets/icon-256x256.png?rev=3762390)

# HantarSMS – OTP & Marketing SMS for Malaysia

 By [HantarSMS](https://profiles.wordpress.org/imeiie1231/)

[Download](https://downloads.wordpress.org/plugin/hantarsms.1.0.0.zip)

 * [Details](https://wordpress.org/plugins/hantarsms/#description)
 * [Reviews](https://wordpress.org/plugins/hantarsms/#reviews)
 *  [Installation](https://wordpress.org/plugins/hantarsms/#installation)
 * [Development](https://wordpress.org/plugins/hantarsms/#developers)

 [Support](https://wordpress.org/support/plugin/hantarsms/)

## Description

HantarSMS connects your WordPress site to [HantarSMS](https://hantarsms.com/), a
Malaysian SMS service that sends from a short code to Maxis, CelcomDigi, U Mobile,
Unifi Mobile and YES numbers. Prepaid, from RM0.20 per SMS, no monthly fee.

One plugin covers the three reasons a Malaysian site sends SMS:

**1. OTP verification codes**

 * “Log in with an SMS code” on the WordPress login page, or anywhere with the `[
   hantarsms_otp_login]` shortcode.
 * Codes are random, stored only as a keyed hash, expire after a few minutes and
   allow five attempts.
 * Limits per phone number and per IP address stop bots from running up your SMS
   bill through your login form.
 * The form does not reveal whether a number belongs to an account, and no SMS is
   sent (or paid for) when it does not.
 * Administrators cannot log in with an SMS code alone, by default.
 * Developers can use `hantarsms_otp_send()` and `hantarsms_otp_verify()` in their
   own forms.

**2. WooCommerce order SMS**

 * An SMS to the customer when an order becomes Processing, Completed, Cancelled,
   Refunded and more — each status with its own editable template.
 * A new-order alert to your own phone numbers.
 * Placeholders such as `{first_name}`, `{order_number}`, `{order_total}` and `{
   shop}`.
 * Sent in the background with Action Scheduler, so checkout is never slowed down.
   Each SMS is noted on the order.
 * Compatible with High-Performance Order Storage and the block-based checkout.

**3. SMS marketing campaigns**

 * An optional, unticked “Send me offers by SMS” checkbox at checkout (classic and
   block checkout), and a consent setting on each user profile.
 * Write a campaign, see the character count, number of segments and estimated cost
   while you type, review, then send now or schedule it.
 * Send to everyone who agreed to marketing SMS, or paste your own list (you confirm
   you have consent).
 * Unsubscribe built in: recipients cannot reply to a short code, so the plugin 
   creates an unsubscribe page and can add its link to every campaign. Unsubscribed
   numbers are removed from every marketing send.
 * Batches of up to 10,000 numbers per request, each with an idempotency key, so
   a retry never sends the same campaign twice.

**Also included**

 * Balance and price per SMS on the settings screen, and a test SMS button.
 * A log of every send with cost and any error, kept for 180 days. Phone numbers
   in the log are masked and OTP codes are never stored.
 * `hantarsms_send_sms( $to, $text )` for developers, plus filters and actions to
   change messages and recipients.

Numbers can be typed in any Malaysian format: 0123456789, 012-345 6789, 60123456789
or +60123456789. Only Malaysian mobile numbers are supported.

### External services

This plugin sends SMS through the HantarSMS API, operated by HantarSMS (https://
hantarsms.com/). It does nothing until you enter an API key from your HantarSMS 
account.

What is sent, and when:

 * When an SMS is sent (an OTP code, an order update, a campaign or a test), the
   plugin sends the recipient phone number(s), the message text and a short reference(
   such as “order-123-processing”) to `https://hantarsms.com/api/v1/messages`, together
   with your API key.
 * When you open the plugin’s admin screens, it requests your account balance from`
   https://hantarsms.com/api/v1/balance`, together with your API key.

No other data about your site or its visitors is sent. HantarSMS passes the phone
numbers and message text to Malaysian mobile operators to deliver the SMS.

 * Terms of Service: https://hantarsms.com/en/terms
 * Privacy and data protection: https://hantarsms.com/en/pdpa-sms-compliance-malaysia

## Screenshots

[⌊Send SMS: audience, message with live segment and cost counter, schedule.⌉⌊Send
SMS: audience, message with live segment and cost counter, schedule.⌉[

Send SMS: audience, message with live segment and cost counter, schedule.

[⌊Review screen before a campaign is sent.⌉⌊Review screen before a campaign is sent
.⌉[

Review screen before a campaign is sent.

[⌊WooCommerce order SMS templates.⌉⌊WooCommerce order SMS templates.⌉[

WooCommerce order SMS templates.

[⌊Log in with an SMS code.⌉⌊Log in with an SMS code.⌉[

Log in with an SMS code.

[⌊SMS log.⌉⌊SMS log.⌉[

SMS log.

## Installation

 1. Install and activate the plugin.
 2. Create a HantarSMS account at https://hantarsms.com/ and add credit. New accounts
    can ask for free trial credit on WhatsApp.
 3. In the HantarSMS console, open **API keys** and create a key.
 4. In WordPress, go to **HantarSMS  Settings**, paste the key and save. Send yourself
    a test SMS.
 5. Turn on what you need: **OTP login**, **WooCommerce** order SMS, and under **Marketing**
    create the unsubscribe page.

You can also put the key in `wp-config.php` instead of the database:

    ```
    define( 'HANTARSMS_API_KEY', 'sk_live_...' );
    ```

## FAQ

### Which numbers can I send to?

Malaysian mobile numbers only (60 1X…). Numbers in other formats are skipped and
shown as invalid before you send.

### How much does it cost?

You pay HantarSMS per SMS segment, from RM0.20, from prepaid credit that does not
expire. The plugin itself is free. One segment holds 156 characters of plain English,
or 66 characters if the message contains Chinese, emoji or other special characters.
The send screen shows the segment count and estimated cost before you confirm. See
https://hantarsms.com/en/pricing.

### Can recipients reply, or reply STOP?

No. Messages come from a shared, send-only short code (66886). That is why the plugin
has an unsubscribe page, and why every message should start with your business name.

### Do I need consent to send marketing SMS?

Yes. Under Malaysia’s Personal Data Protection Act you need consent for direct marketing
and must stop when someone asks. The plugin only sends campaigns to people who ticked
the consent box (or to a list you confirm has consented), and always removes unsubscribed
numbers. Order updates and OTP codes are not marketing.

### How do users log in with an SMS code?

Their number must be saved on their account: the “Mobile number (SMS)” field on 
the WordPress profile, or the WooCommerce billing phone. If two accounts share a
number, SMS login is refused for that number.

### Can I use the OTP functions in my own forms?

Yes:

    ```
    $sent = hantarsms_otp_send( $phone, 'my-form' );
    $ok = hantarsms_otp_verify( $phone, $code, 'my-form' );
    ```

Both return `true` or a `WP_Error`. The purpose (‘my-form’) makes sure a code sent
for one form cannot be used in another.

### My site is behind Cloudflare or a proxy. Are the IP limits correct?

By default the plugin uses REMOTE_ADDR, because forwarded headers can be forged.
If your server sees the proxy’s address, return the real visitor IP with the `hantarsms_client_ip`
filter.

### Where are delivery reports?

The plugin log shows whether HantarSMS accepted each send. Per-number delivery results
are in your HantarSMS console.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“HantarSMS – OTP & Marketing SMS for Malaysia” is open source software. The following
people have contributed to this plugin.

Contributors

 *   [ HantarSMS ](https://profiles.wordpress.org/imeiie1231/)

[Translate “HantarSMS – OTP & Marketing SMS for Malaysia” into your language.](https://translate.wordpress.org/projects/wp-plugins/hantarsms)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/hantarsms/), check 
out the [SVN repository](https://plugins.svn.wordpress.org/hantarsms/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/hantarsms/) by [RSS](https://plugins.trac.wordpress.org/log/hantarsms/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.0

 * First release: OTP login, WooCommerce order SMS, SMS marketing campaigns with
   consent and unsubscribe, send log.

## Meta

 *  Version **1.0.0**
 *  Last updated **2 days ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.2 or higher **
 *  Tested up to **7.1.3**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [malaysia](https://wordpress.org/plugins/tags/malaysia/)[otp](https://wordpress.org/plugins/tags/otp/)
   [sms](https://wordpress.org/plugins/tags/sms/)[sms marketing](https://wordpress.org/plugins/tags/sms-marketing/)
   [woocommerce](https://wordpress.org/plugins/tags/woocommerce/)
 *  [Advanced View](https://wordpress.org/plugins/hantarsms/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/hantarsms/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/hantarsms/reviews/)

## Contributors

 *   [ HantarSMS ](https://profiles.wordpress.org/imeiie1231/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/hantarsms/)