How to Create a Link That Sends an SMS Text Message

Back to Navigating SMS

With a bit of HTML, it's possible to create a hyperlink that sends an SMS message. You can even prepopulate the SMS body text via the link! Here's how.

Sending SMS Texts from a Link

Links need no introduction. They’re everywhere on the internet, literally. In HTML, links are defined with the <a> tag. They also contain an href attribute that specifies where the link should, well, link to. Many developers know that they can launch an email using “href=”” You can also start a phone call using “href=”tel:+1954123555.” But few people know that you can launch the SMS app on your website visitors’ phones with an HTML link. This is perfect for starting conversations with your customers, especially when you consider that you can add a Click to Text link to more than just text.

Add Click to Text to the following places, or anywhere you may include an HTML link:

  • Your site’s drop-down menu or main navigation
  • Your contact page
  • Images
  • Call to Action text
  • Buttons
  • Email signatures

It only take a couple of minutes to create an HTML link that sends a text. And you can even pre-populate the SMS body text via the HTML link. Here’s how:

1. Write Your Link Text

This is the text that your website visitors will read and click on. Keep it simple, and be sure to make it clear what will happen when they click. For example, “Click here to send us a text.”

2. Write Your Default SMS Message

When visitors click on your link, their SMS app will be launched with a pre-written message. Consider who your users are, what they’re looking for, and why they’re communicating with you. Then go ahead and write your default message. A restaurant, for example, may want to use the message, “Hi there, I’d like to place or order for…” Be sure to place your message through a URL encoder.

3. Create Your Hyperlink

Now that you have the link text and SMS message written, it’s time to put the two together. If you’ve ever added an HTML link to your website, the process for creating a Click to Text link is exactly the same. Set up your href attribute like this:

<a href="sms:+18664504185&body=Hi%2520there%252C%2520I%2527d%2520like%2520to%2520place%2520or%2520order%2520for...">Click here to text us!</a>

💡SimpleTexting Tip: Gmail and Outlook strip HREF tags, so in order to circumvent any SMS protocol related speed bumps, try to use an email service like MailChimp!

Hiding Your Link on Mobile and Other Challenges

As with all new technologies, there are still some discrepancies across operating systems and devices. Even though many desktops and laptops are capable of sending SMS messages, these links work best on mobile devices. We recommend hiding your Click to Text link on desktop. Some versions of iOS don’t accept pre-written messages. Use an analytics tool to determine what OS the majority of your visitors use, then adjust accordingly.

Should You Add Texting to Your Website?

In most cases, the answer is yes. The internet is slowly coming around to the realization that consumers prefer communicating with brands via text message. Still, updating your website with a text-enabled number is a big decision. If you have any doubts or need help getting set up, reach out to our support team by clicking the blue chat bubble in the corner of your screen. We’re here for you.

You might also like...