Guide · For businesses
How to add a WhatsApp button to your website (link, floating button and QR)
A WhatsApp chat button for any website in about 15 minutes: the wa.me link format, copy-paste HTML and floating-button code, WordPress, Shopify and Wix steps, click tracking, a QR code for print, and when a chatbot behind it pays off.
By Broadchat teamPublished 10 min read
In short
To add a WhatsApp button to your website, make a click-to-chat link in the format https://wa.me/919829012345?text=your%20message (country code and number as digits only, message URL-encoded), then put it behind a button: an HTML link, a floating button, or your site builder's button or block. Test it on a phone and a laptop, track clicks with your analytics tool, and use the same link in a QR code for print. When chats outgrow one phone, put an API number with a chatbot and shared inbox behind the same button.
Key takeaways
- A WhatsApp button is just a link: https://wa.me/ followed by the full international number, digits only, with no plus sign, leading zero, spaces or dashes.
- Add ?text= with a URL-encoded message to pre-fill the customer's first message. A different message per page tells you where each chat came from.
- WhatsApp's official Chat on WhatsApp button comes in green and white and three sizes, in English only, and should be used unchanged.
- WordPress.com has a WhatsApp Button block on Premium, Business and Commerce plans; on Wix you link any button to a WhatsApp address; on Shopify use a theme edit or an app.
- wa.me gives no click statistics. Your analytics can count clicks (Google Analytics 4 records outbound link clicks by default), and per-page messages show which pages bring chats.
- The link works for any WhatsApp number, app or API. An API number behind the button adds a chatbot and shared inbox without changing the button.
Add a WhatsApp chat button to a website
Time needed: 15 min. You will need: Your website editor or theme files, The free WhatsApp link generator, A phone with WhatsApp for testing.
Build the wa.me link
Write the number as country code plus number in digits only (91 and the 10-digit mobile number for India) after https://wa.me/. Add ?text= and a URL-encoded message such as Hi%2C%20I%20want%20a%20quote. The link generator does this for you.
Put the link behind a button
Paste the HTML link where the button should appear, or add the floating-button code before the closing body tag so it shows on every page. Use the official Chat on WhatsApp button image if you want WhatsApp's own design.
Use your site builder's option
On WordPress.com add the WhatsApp Button block; on self-hosted WordPress use a Custom HTML block or a header and footer plugin; on Wix link a button to the WhatsApp address; on Shopify duplicate the theme, then edit code or use an app.
Test on phone and laptop, then track clicks
Tap the button on a phone (it should open the WhatsApp app) and click it on a laptop (it should open WhatsApp Web or desktop). Check that clicks show up in your analytics and use a different pre-filled message per page.
Make a QR code for print
Turn the same link into a QR code for counters, packaging and visiting cards, and scan the printed proof with two different phones before printing in bulk.
The short answer
To add a WhatsApp button to your website you need one thing: a click-to-chat link. WhatsApp's own format is https://wa.me/<number>, where the number is in full international format without zeros, brackets or dashes. Put that link behind a button, an icon or a floating bubble, and a visitor who taps it lands in a chat with you, with your message already typed. No plugin, app or API is required, and the customer does not need to save your number first.
This guide covers the link, ready-to-paste code, the WordPress, Shopify and Wix options, tracking, a QR code for print, and when a WhatsApp chatbot behind the button is worth it. It is for any business that takes enquiries on WhatsApp, whether you use the free Business app or the API.
Step 1: build the wa.me link
WhatsApp's Help Center gives these formats:
| You want | Link format |
|---|---|
| Open a chat with your number | https://wa.me/919829012345 |
| Open a chat with a pre-filled message | https://wa.me/919829012345?text=Hi%2C%20I%20want%20to%20book%20an%20appointment |
| Let the visitor pick any contact to send your text to (no number) | https://wa.me/?text=Try%20Sunrise%20Clinic%20for%20WhatsApp%20bookings |
Rules that cause most broken buttons:
- Number: country code then number, digits only. For an Indian mobile 98290 12345 that is
919829012345. Do not write+91,0091,09829012345or spaces. WhatsApp's own example of what not to use is a number with a plus, leading zeros, brackets and dashes. - Message: must be URL-encoded. A space becomes
%20, a comma%2C, a line break%0A. Hindi and emoji are encoded the same way and arrive intact. - The number must be on WhatsApp. Click to chat opens a chat only with a number that has an active WhatsApp account.
The quickest way is our free WhatsApp link generator: pick India, type the number in any format, write the message, and copy the link or a ready HTML snippet. It checks the number length, so typos are caught before customers find them.
Step 2: put the link behind a button
A simple inline button
Paste this where the button should appear, for example on the contact page or under each product's price. Replace the number and message with yours:
<a href="https://wa.me/919829012345?text=Hi%20Sunrise%20Clinic%2C%20I%20want%20to%20book%20an%20appointment"
target="_blank" rel="noopener" aria-label="Chat with us on WhatsApp"
style="display:inline-block;background:#25D366;color:#fff;padding:12px 20px;border-radius:8px;font-weight:600;text-decoration:none">
Chat on WhatsApp
</a>A floating button on every page
A floating button stays in the bottom corner while the visitor scrolls. Add this once, just before the closing </body> tag of your site template or in your builder's site-wide footer code:
<a class="wa-float" href="https://wa.me/919829012345?text=Hi%2C%20I%20have%20a%20question%20(website)"
target="_blank" rel="noopener" aria-label="Chat with us on WhatsApp">WhatsApp us</a>
<style>
.wa-float { position: fixed; right: 16px; bottom: 16px; z-index: 999;
background: #25D366; color: #fff; padding: 12px 18px; border-radius: 999px;
font: 600 15px/1 sans-serif; text-decoration: none;
box-shadow: 0 2px 8px rgba(0,0,0,.25); }
</style>Check it on a phone: a floating button must not cover your own Add to cart or Call button, cookie banner or chat widget. Move it to the left or raise bottom if it does.
WhatsApp's official Chat on WhatsApp button
If you prefer WhatsApp's own design, the click-to-chat article links to the official Chat on WhatsApp button files. They come in green and white and in small, medium and large sizes, and are currently available only in English. WhatsApp's guidance is to use the button as it is, use the latest version and keep it visible and readable. You embed the image inside the same kind of link:
<a aria-label="Chat on WhatsApp" href="https://wa.me/919829012345">
<img alt="Chat on WhatsApp" src="/images/WhatsAppButtonGreenLarge.svg">
</a>Step 3: the WordPress, Shopify and Wix options
| Platform | How to add the button | Notes |
|---|---|---|
| WordPress.com | Click the + block inserter, search for WhatsApp and add the WhatsApp Button block, then set the number and first message in the block settings | Available on Premium, Business and Commerce plans |
| Self-hosted WordPress | Paste the inline snippet in a Custom HTML block on one page, or the floating snippet site-wide through a header and footer plugin or your child theme's footer | Do not edit the parent theme; updates overwrite it |
| Wix (Wix Editor) | Add a button, change its text to something like "Contact on WhatsApp", click the Link icon → Web Address, enter https://api.whatsapp.com/send?phone=<number> and add &text=your%20message for a pre-filled message | Number in international format, no zeros, brackets or dashes |
| Shopify | Duplicate your theme first, then Online Store → theme menu → Edit code and add the snippet to the theme layout, or install a WhatsApp button app from the Shopify App Store | Shopify warns that code edits can be removed by a theme update |
Wix's help article uses the api.whatsapp.com/send?phone= form of the link; it opens the same chat as a wa.me link, so either works there. For WordPress sites that want a pre-chat form before WhatsApp opens (name, service, preferred time), see the WhatsApp chat widget for WordPress.
A worked example
Meera's Bakehouse in Pune sells cakes from a three-page Wix site. She adds a different button on each page so every chat tells her where the customer was:
| Page | Pre-filled message |
|---|---|
| Home | Hi Meera's Bakehouse, I want to order a cake (home page) |
| Menu | Hi, I saw the menu and want to order: |
| Custom cakes | Hi, I want a custom cake for (date), (flavour), (size) |
The Custom cakes message works as a mini form: customers fill in the brackets before sending, and Meera can quote in one reply instead of three questions.
Step 4: test it and track clicks
Test on two devices before you publish. On a phone, the link opens the WhatsApp app. On a computer, it opens WhatsApp Web or the desktop app, where the visitor needs a linked phone. If you see an error screen, the number is almost always wrong: check for a stray +, 0 or space.
wa.me itself gives you no click statistics. Three ways to measure anyway:
- Analytics click events. In Google Analytics 4, enhanced measurement records an outbound
clickevent, with thelink_url, each time a visitor clicks a link that leads away from your domain, and that covers a wa.me link. Filter the event by alink_urlcontainingwa.meto count WhatsApp button clicks per page. - Per-page messages. As in Meera's example, a different pre-filled message per page or campaign shows the source in the chat itself.
- UTM tags on the pages, not on the wa.me link. Tag the links that bring visitors to your page (ads, Instagram bio, email) with UTM parameters, so analytics can tie a WhatsApp click back to the campaign. WhatsApp does not report anything on the wa.me URL, so UTM tags added to it tell you nothing.
Step 5: a QR code for print
The same link works offline as a QR code on counters, menus, packaging, hoardings and visiting cards. Paste your wa.me link into the WhatsApp QR code generator, download SVG for the printer, and scan the printed proof with two different phones before you print in bulk. Keep the pre-filled message short: a long message makes a denser code that needs a bigger print.
When a chatbot behind the button helps
The button only starts the chat. What happens next depends on the number behind it:
- Business app number. Fine while one person answers. The greeting message and quick replies cover common questions; see setting up the WhatsApp Business app.
- API number. Worth it when several people answer, chats arrive outside office hours, or the same questions repeat all day. A chatbot can answer prices and timings, collect the order details and hand over to a person in a shared inbox, and the button on your site stays exactly the same.
When the customer sends the first message, a 24-hour customer service window opens in which you can reply freely. On the API those replies are service messages: since 1 Oct 2026 each business phone number gets 1,000 free per month and Meta charges for service messages after that, so check WhatsApp API pricing before you expect heavy volume. In India, coexistence lets you keep using the Business app on the same number while a platform adds the chatbot and inbox. For no-code bot ideas, read how to build a WhatsApp chatbot without code and our WhatsApp marketing strategy guide.
Web agencies can add this to every site they build. With a white-label WhatsApp platform the chatbot and inbox behind the button run under the agency's own brand.
Sources
- How to use click to chat — WhatsApp Help Center, checked 31 October 2026
- WhatsApp brand resources — Meta, checked 31 October 2026
- WhatsApp Button block in WordPress — WordPress.com Support, checked 31 October 2026
- Wix Editor: Adding a Link to WhatsApp on Your Site — Wix Help Center, checked 31 October 2026
- Editing theme code — Shopify Help Center, checked 31 October 2026
- Enhanced measurement events — Google Analytics Help, checked 31 October 2026
- Pricing on the WhatsApp Business Platform — Meta for Developers, checked 31 October 2026
Broadchat team · Product and partner success team
The people who build and support Broadchat, the white-label WhatsApp Business API platform. We write from what we see while onboarding partners and their clients on the official WhatsApp Cloud API, and we check every article against Meta's current documentation.
Last updated:
Frequently asked questions
Do I need a plugin or the WhatsApp API to add a WhatsApp button to my website?
No. A WhatsApp button is a normal link to https://wa.me/ followed by your number in international format, digits only. Any website builder that can link a button to a web address can do it. A plugin or the API only adds extras such as a pre-chat form, a chatbot or a shared inbox.
How do I add a pre-filled message to a wa.me link?
Add ?text= followed by the URL-encoded message after the number, for example https://wa.me/919829012345?text=Hi%2C%20I%20want%20a%20quote. Spaces become %20 and commas %2C. The customer can still edit the text before sending. The free WhatsApp link generator encodes it for you.
Why does my WhatsApp button open an error page?
Usually the number is wrong. It must be the country code plus number, digits only, with no plus sign, leading zero, spaces or dashes: 919829012345 for an Indian mobile. The number must also have an active WhatsApp account.
Does the WhatsApp button work on a laptop?
Yes. On a computer the link opens WhatsApp Web or the WhatsApp desktop app, where the visitor can send the message from their linked account. On a phone it opens the WhatsApp app directly.
Can I see how many people clicked my WhatsApp button?
Not from WhatsApp; wa.me has no statistics. Use your website analytics instead: Google Analytics 4 enhanced measurement records outbound link clicks by default, so you can count clicks on links containing wa.me. A different pre-filled message per page also shows where each chat came from.
Can I add a WhatsApp button for free on WordPress.com?
The native WhatsApp Button block is available on WordPress.com Premium, Business and Commerce plans; Free and Personal plans need an upgrade. On any plan you can still add a regular button or text link that points to your wa.me link.