How to add a WhatsApp button to your website, with a prefilled message
Yeheli Sampson · · 3 min read
The short answer
Build a link in the format https://wa.me/972XXXXXXXXX, add ?text= with an encoded message, and put it on a button that is visible without scrolling. On mobile, add a floating button in the corner too. Test from your phone that the chat opens with the right message.
In Israel many customers would rather write on WhatsApp than fill a form or call. A good WhatsApp button turns a site visit into a conversation in one tap.
This guide shows exactly how to build the link, how to add a ready message, and where to put the button so people actually tap it.
Step 1: Build the link
WhatsApp's official click-to-chat link is wa.me, followed by the number in international format:
https://wa.me/972501234567- Start with 972, Israel's country code
- Drop the 0 at the start of the number
- No plus sign, no dashes and no spaces
For example, 050-123-4567 becomes 972501234567.
Step 2: Add a prefilled message
You can add a message that appears in the text box when the chat opens. The customer just taps send. Add ?text= followed by the message, URL-encoded (a space becomes %20):
https://wa.me/972501234567?text=Hi%2C%20I%27d%20like%20details%20aboutThe easy way to encode: open your browser console and run encodeURIComponent on the message, or use any free URL encoder.
A good message gives you context. For example: Hi, I came from your website and I'd like details about. That tells you where the inquiry came from and what it is about.
Step 4: Where to put it
- 1
On the first screen
The button should be visible without scrolling, next to the main headline.
- 2
A floating button on mobile
A round button in the corner that stays put while scrolling. Someone convinced halfway down the page should not have to scroll back up.
- 3
At the end of each page
After the visitor has read, give them the next step.
- 4
On your Google Business Profile
Add the link to your profile too, so people coming from Maps can write straight away.
Step 5: Set up WhatsApp Business
The WhatsApp Business app is free and gives you a few tools that help you answer better:
- A business profile with hours, address and website
- An automatic greeting for new customers
- An away message when you are not available
- Quick replies for questions that repeat
Step 6: Test it
- Tap the button on your phone and check the chat opens with the right number
- Check the prefilled message appears and reads correctly
- Test on a laptop too, where the link opens WhatsApp Web or the app
Questions on this topic
Do I need WhatsApp Business for the button?
No. The link works with regular WhatsApp too. WhatsApp Business adds tools such as a greeting message and quick replies.
Why does my prefilled message show strange characters?
It was probably not URL-encoded. Encode it with encodeURIComponent or an encoding tool, then paste it in.
Does the button work on desktop?
Yes. On a laptop the link opens WhatsApp Web or the desktop app.