How to Create and Test a WhatsApp Click-to-Chat Link

Learn how to create a WhatsApp click-to-chat link, encode a seasonal message, and check the customer experience on mobile and desktop before launch.

Published
Reading time
5 min read
How to Create and Test a WhatsApp Click-to-Chat Link
On this page

A WhatsApp click-to-chat link lets a customer start a conversation with your business without first saving your number. For a seasonal campaign, you can add a prefilled message so customers have a simple starting point.

This tutorial shows how to create a WhatsApp click-to-chat link, encode a message safely, and check the link on mobile and desktop before sharing it.

Verification note: WhatsApp’s official documentation was not available to consult for this article, and the example was not tested on devices. Confirm the current link requirements with WhatsApp and perform the checks below before launching your campaign.

Key Takeaways

  • Use the https://wa.me/ format followed by the business phone number in international format, using digits only.
  • Put the prefilled message in the text query parameter and encode the message, not the entire URL.
  • Test with a real business number on both mobile and desktop; the example number below is fictional.
  • Keep personal information and confidential offer codes out of links that customers may share.

Start with the business phone number

The basic click-to-chat format is https://wa.me/ followed by the recipient’s complete international phone number. Use digits only: omit the + sign, spaces, parentheses, and dashes. Omit an international dialing prefix, such as 00, and any domestic trunk prefix that does not belong in the international number. Whether a leading zero is omitted depends on the country’s numbering rules.

For example, the fictional US number +1 (202) 555-0123 would be written as 12025550123. The resulting illustrative link is https://wa.me/12025550123. Replace that number with your actual business number; the example is not a working campaign destination.

The destination number needs to be associated with a WhatsApp account. Double-check the country code and number before publishing: a correctly formatted link can still point to the wrong recipient.

Advertisement

Add a seasonal message

Suppose you want customers to start with this message:

Hello! Spring sale & gifts
Are offers still available?

Add ?text= after the phone number, followed by the encoded message. In the encoded value, spaces become %20, the ampersand becomes %26, and the line break becomes %0A. The question mark at the end becomes %3F.

The complete illustrative link is:

https://wa.me/12025550123?text=Hello!%20Spring%20sale%20%26%20gifts%0AAre%20offers%20still%20available%3F

The ampersand matters: an unencoded & in a query string can be interpreted as the start of another parameter instead of part of the message. Likewise, encoding the entire URL as one value would also encode structural characters such as :, /, ?, and =, rather than preserving them as the link’s structure.

Generate the message value in a browser

If you are comfortable using your browser’s developer console, this JavaScript builds the link from a number and a plain-text message. Replace the fictional number before using the result.

const phone = "12025550123"; // Replace with your business number, digits only.
const message = "Hello! Spring sale & gifts\nAre offers still available?";
const link = `https://wa.me/${phone}?text=${encodeURIComponent(message)}`;

console.log(link);

Copy the URL shown by your browser into a test page or address bar. The message is encoded once by encodeURIComponent; do not encode that result a second time. If you use an encoder instead, give it only the plain-text message and paste its encoded result after ?text=.

The prefilled message is a draft for the customer to review or edit. Opening the link should not be treated as proof that a message was sent.

Test before the campaign goes live

Use your real business number and the final campaign link for these checks. Test from an account other than the destination account where practical, and ask a colleague with permission to confirm receipt. Screens and prompts can differ by device, browser, and WhatsApp setup.

  1. Check the destination. Open the link and confirm that it identifies the intended business account, not just a number that looks similar.
  2. Check the draft. Confirm the full message appears with the ampersand and line break intact. Edit and send a test message only when you are ready, then confirm it reaches the intended account.
  3. On mobile, try the link from the actual campaign placement, such as an email or social profile. Check whether the browser offers to open WhatsApp and whether the conversation and draft appear.
  4. On desktop, try the link in a browser with your normal WhatsApp setup. Follow any prompt to continue to the desktop app or WhatsApp Web, and verify the destination and draft.
  5. Check the fallback. Try a browser or device where WhatsApp is not available, and a browser session where you are not signed in. Look for prompts to open or install WhatsApp or sign in. The exact flow may vary; do not assume that a chat opens automatically or that the link falls back to SMS.
  6. Retest the published placement. Campaign editors and link shorteners can alter links. Open the final published link and repeat the destination and draft checks.

If the sender is not signed in, they may need to sign in before continuing. If the recipient is offline, opening the link alone does not establish when they will read or respond to a message. If a number cannot be reached, check its international format and whether it is associated with WhatsApp.

Advertisement

Common Mistakes

  • Adding + or punctuation to the link’s number. Keep the number portion to international-format digits.
  • Leaving the message unencoded. Special characters can change how the query string is interpreted.
  • Encoding the whole link or encoding twice. Encode the message value once, then attach it to the URL.
  • Testing only on the device used to build the link. Mobile, desktop, signed-out sessions, and campaign platforms can behave differently.
  • Assuming a draft is a sent message. Confirm receipt separately during an authorized test.

Best Practices

Use a short, neutral prompt that works even if a customer shares the link. Do not include customer names, phone numbers, personal information, or confidential offer codes in the URL: links can be copied, forwarded, stored in browser history, and exposed through campaign systems.

Keep a human-readable contact option alongside the link for people who cannot use WhatsApp. After any change to the number, message, campaign platform, or shortened link, repeat the tests before distributing it widely.

Conclusion

Build the link with an international-format business number and an encoded message, then verify the destination and draft on both mobile and desktop. A short test of the signed-out or unavailable-app experience can also reveal friction before customers encounter it.

What would your domain sell for?

A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.