How to Create a link that sends a text message
This post may contain affiliate links. I may earn a commission at no extra cost to you if you make a purchase through them. Full disclosure here.
Creating a link that sends a text message is a simple way to encourage mobile visitors to contact you directly from your website. When a user clicks the link on their smartphone, it automatically opens their default messaging app with a pre-filled recipient and message body.
This guide will walk you through the process of creating these "click-to-text" links using HTML, along with best practices and examples to help you get started.
To create a link that sends a text message:
Use the following HTML structure:
<a href="sms:phonenumber?&body=message">Link Text</a>
Replace
phonenumber
with the recipient's phone number, including the country code (e.g., 12125551234).Replace
message
with the pre-filled text you want to appear in the recipient's messaging app, URL encoding any spaces or special characters.Replace
Link Text
with the text you want the link to display on your site (e.g., "Text Us").
When a user clicks the link on their smartphone, it will open their default messaging app with the recipient number and message body already filled in, ready to send.
Why Use a Click-to-Text Link?
Click-to-text links offer several benefits for businesses looking to improve customer engagement and lead generation:
Convenience: Making it easy for visitors to text you directly from your site improves the user experience.
Increased Engagement: Providing a frictionless way to contact you can lead to more inquiries and sales.
Versatility: You can add click-to-text links to your website, emails, social media, and more.
Customization: Pre-fill the recipient's number and message body to streamline the process.
How to Create a Click-to-Text Link
Creating a click-to-text link is as simple as adding a few parameters to a standard HTML link. Here's the basic structure:
<a href="sms:phonenumber?&body=message">Link Text</a>
phonenumber
: Replace this with the phone number you want the message sent to, including the country code (e.g., 12125551234).message
: Replace this with the pre-filled message you want to appear in the recipient's messaging app. URL encode any spaces or special characters (e.g.,%20
for spaces).Link Text
: Replace this with the text you want the link to display on your site (e.g., "Text Us").
For example, to create a link that sends a message to 212-555-1234 with the pre-filled text "Sign me up for your newsletter!", you would use:
<a href="sms:12125551234?&body=Sign%20me%20up%20for%20your%20newsletter!">Text Us</a>
When a user clicks this link on their smartphone, it will open their default messaging app with the recipient number and message body already filled in, ready to send.
Best Practices for Click-to-Text Links
Keep it simple: Use clear, concise link text that conveys the action (e.g., "Text Us" or "Sign Up for Texts").
Incentivize: Offer a compelling reason for visitors to text you, like a discount, contest, or exclusive content.
Optimize for mobile: Ensure your website is mobile-friendly and the link is easy to tap on small screens.
Test: Check that the link opens the messaging app correctly and the pre-filled content looks as expected.
Comply with regulations: Follow SMS marketing best practices and obtain consent before sending promotional messages.
Examples of Click-to-Text Links in Action
Here are a few examples of how businesses are using click-to-text links:
Backcountry: Offers a discount to visitors who text a keyword to opt-in to their SMS marketing list.
Xero Shoes: Encourages visitors to text "WIN" for a chance to win $100 when they sign up for text alerts.
Dr. Bob's Dentistry: Includes a link in their SMS auto-reply that opens with a pre-filled message to schedule an appointment.
By incorporating click-to-text links into your website and marketing campaigns, you can make it easier than ever for customers to engage with your business and take action.