Skip to main content
24/7 Available
How-To Guides

How to Add a WhatsApp Chat Button to Your Website

2026-11-22•7 min read•By Apex Web Expert Team
Photo for article: How to Add a WhatsApp Chat Button to Your Website

Most of your visitors will never fill in a contact form. They read your page, they have one question, and the form feels like too much work for a two-line question. So they leave, and you never find out what they wanted to ask. A WhatsApp chat button fixes that exact moment. It puts a small green button in the corner of your site, and one tap opens a WhatsApp conversation with your business. No account to create, no form to fill, no waiting for an email reply. This guide shows you how to add one, the free way and the no-code way, and the mistakes that make most buttons useless.

In This Guide

What a WhatsApp Chat Button Actually Does

A WhatsApp chat button is a clickable icon or widget on your website that opens a direct WhatsApp conversation with your business the moment a visitor taps it. On a phone it opens the app; on a desktop, WhatsApp Web. One misunderstanding trips people up: WhatsApp does not support a fully embedded, in-page chat window. Every button, widget, or "embed" hands the visitor over to WhatsApp itself. The conversation never happens inside your page.

The reason the button works so well is that your visitors already live in WhatsApp. Meta says more than 3 billion people use WhatsApp each month, in over 180 countries, and in Pakistan and much of the rest of the world it is the default way people message a business. A visitor who taps it is not learning a new tool or creating an account. They are doing something they already do a dozen times a day. And unlike a contact form, the chat stays on their phone after they leave your site, so you can answer later and the conversation is still there.

The Three Ways to Add One

Three honest routes, and the right one depends on how much control you want and how comfortable you are with a little code.

  • A wa.me click-to-chat link. Free, takes minutes, and gives you the most control over the first message. The route we recommend for most small sites.
  • A floating button built with HTML and CSS. Also free. It sits in the corner of every page and follows the visitor as they scroll. One small snippet, no plugin, nothing to update.
  • A widget or plugin. No code at all. You get greeting pop-ups, business hours, and a button per department if you need them. Free plans exist, and paid widgets start from about $5 a month.

Everything starts with one link. WhatsApp's click-to-chat feature lets anyone start a chat with a number they never saved, and the link format is short: https://wa.me/<number>. The number is where most people go wrong. WhatsApp's own rule: the full number in international format, with no zeroes, brackets, or dashes. Digits only, country code first, no plus sign, no spaces. Written the usual way, +1 (555) 123-4567 becomes 15551234567. The number has to be registered on WhatsApp, or the visitor sees an error instead of a chat.

Step 1: write the link. Take your business WhatsApp number, strip out everything except the digits, put the country code at the front, and place it after wa.me/. That link on its own is a working chat button, ready to sit behind any text or button on your site, in your email signature, or in your social bios.

Step 2: pre-fill the first message. Add ?text= followed by a URL-encoded message, and WhatsApp places it in the chat box, ready to send or edit. A space becomes %20 and a comma %2C, so "Hi, I have a question about your pricing" becomes Hi%2C%20I%20have%20a%20question%20about%20your%20pricing. The full link looks like this: https://wa.me/919876543210?text=Hi%2C%20I%20have%20a%20question%20about%20your%20pricing.

Here is the part most guides skip: use the pre-filled message to carry context. A plain "Hi" tells you nothing. A product page can pre-fill the product name, a pricing page the plan, a booking page the service, so your team knows what the visitor was looking at before anyone types a word. If you write the message by hand, watch out for the & character, which must be encoded as %26 or it breaks the link. An online URL encoder, or JavaScript's encodeURIComponent function, handles all of this for you.

Step 3: put the link where people look. The contact page is the obvious spot, but the link earns its keep on product and pricing pages, where questions actually happen. A button that says "Chat with us on WhatsApp" gets far more taps than a plain text link, because people recognise what will happen when they tap it. Add target="_blank" so desktop visitors get WhatsApp Web in a new tab while your page stays open.

Method 2: A Floating Button You Build Yourself

A floating button stays in a corner of the screen as the visitor scrolls, and it needs no plugin and no JavaScript. If you manage your site's code directly, this is a ten-minute job. Paste the HTML once, just before the closing </body> tag, with your own number in place of the example:

<a class="wa-float" href="https://wa.me/15551234567?text=Hi%2C%20I%20have%20a%20question" target="_blank" rel="noopener">Chat with us</a>

.wa-float {
  position: fixed;
  right: 18px; bottom: 18px;
  width: 56px; height: 56px;
  border-radius: 999px;
  background: #25D366;
  z-index: 9999;
}

A few details in that snippet are doing quiet work. The bottom-right corner is where visitors expect to find chat options. The green is WhatsApp's own colour, which people recognise instantly. The fixed position keeps the button visible on every page without adding it to each page by hand. On phones, leave room for the notch and the home indicator. If it ends up covering your cookie banner or checkout button, raise the bottom value or lower the z-index until it clears them.

Method 3: WordPress and Shopify Without Touching Code

If your site runs on WordPress and you would rather not touch raw code, you have two paths. Without a plugin, build your wa.me link as above, then add a Custom HTML block inside any page or post and paste the link in. For a floating button on every page, open the Site Editor, edit the footer template, and add a Custom HTML block there, with the CSS in your theme's Additional CSS setting. Then clear your cache and test on a phone and a desktop. With a plugin, judge it on its listing page: when it was last updated, whether it is tested with your WordPress version, whether its script loads on every page, whether it allows a different pre-filled message per page, and what data it collects. A plugin earns its place when you need scheduling or several departments; for one number and one button, the snippet is lighter.

Shopify gives you three places to put it. The fastest is a menu link: in your admin, go to Content, then Menus, and add an item whose link is your wa.me URL. The second is a floating button with the snippet above, added through a Custom Liquid section in the footer of your theme. The third is an app from the Shopify App Store, which usually adds itself as an app embed. If you would rather not touch theme code at all, this is the kind of small job we handle inside our web design services, and it takes less time than most people expect.

Don't Forget Desktop Visitors

Here is the gap most setups miss. On a phone, the button opens the app and everything works. On a desktop it opens WhatsApp Web, which only works if the visitor is logged in there. Plenty of people are not, and for them the button leads to a login screen instead of a conversation. The fix is cheap: add a QR code on your contact page, and on printed material like packaging or a shop counter card, so a desktop visitor can point their phone at the screen and start the chat that way. QR codes are free to generate. Our guide to getting more leads from your website covers the wider point: every extra step between a visitor and your inbox costs you enquiries.

Five Mistakes That Make the Button Useless

The button itself is simple. The mistakes decide whether it brings you conversations or just sits there.

Hands holding a smartphone showing a green WhatsApp chat screen in a small shop

  • The wrong number format. A plus sign, a space, or a leading zero in the wa.me link, and the visitor sees an error instead of a chat. Test every link on a phone that is not yours, because your own phone can hide the problem.
  • A blank first message. A pre-filled "Hi" gives your team nothing to work with. Pre-fill the page context, the product, or the plan, so the first reply can be useful instead of "How can I help?"
  • A button that covers the checkout. If it sits on top of your cookie banner, your add-to-cart bar, or your own call-to-action, it is in the way. Move it, shrink it, or show it only where it helps.
  • Nobody answering. People use WhatsApp because it is fast. A button that goes unanswered for a day is worse than no button at all, because it promised a conversation and delivered silence. If nobody can watch the inbox, set business hours in the greeting, or use an auto-reply that says when you will respond.
  • Two chat tools fighting each other. A live chat widget and a WhatsApp button in the same corner is clutter, and visitors pick neither. Choose one primary way to get help, and make it obvious. Our guide to adding live chat to your website explains the on-site option, so you can compare the two before you decide.

When the Button Isn't Enough

A chat button is the entry point. What happens after the click is where most businesses eventually need more than a link. As volume grows, most teams add a shared inbox, so every chat lands in one place, plus quick replies for the questions that come up ten times a day. Some add scoped automation for order status, pricing, or bookings, which Meta's current policy permits. One Shopify lifestyle brand, Oxwhite, reported a 20 percent lift in conversion rate after routing its website chat through WhatsApp, according to the case study published by Wati. One brand's result, not a promise, but it shows what happens when the chat after the click is handled well.

If you want the button, the inbox, and the auto-replies set up as one job instead of three separate afternoons, talk to us. We will set it up, test it on a real phone and a real desktop, and leave you with a button that starts conversations.

A WhatsApp chat button will never be the most impressive thing on your website. It is a small green circle in a corner. But it is the shortest distance between a visitor with a question and a business with an answer, and on most small business sites that distance is the whole sale. Add the link, pre-fill a useful first message, keep the button clear of everything else, and answer quickly. If you would like it built and tested properly as part of a site set up to win enquiries from day one, talk to us. We will get it done.

Frequently Asked Questions

Is it free to add a WhatsApp chat button to my website?

Yes, the two simplest routes cost nothing. A wa.me click-to-chat link is free, and a floating button built with a few lines of HTML and CSS is free too. No-code widgets have free plans, with paid plans starting from about $5 a month. You only start paying when you need the WhatsApp Business Platform, which Meta charges per conversation, and that is only for businesses that send messages first, like order confirmations.

Do visitors need WhatsApp installed for the button to work?

On a phone, tapping the button opens the WhatsApp app, or the app store if it is not installed. On a desktop, it opens WhatsApp Web in a new tab, which only works if the visitor is logged in there. That is why a QR code on your contact page is worth adding: a desktop visitor can scan it with their phone and start the chat that way.

Can I add a WhatsApp button to WordPress or Shopify?

Yes. On WordPress, add a Custom HTML block with your wa.me link, or use a plugin if you need business hours or several departments. On Shopify, add the link as a menu item, use a Custom Liquid section in the footer for a floating button, or install a chat app from the App Store. The article above walks through each route step by step.

Does the button put a live chat window inside my website?

No. WhatsApp does not support a fully embedded, in-page chat window. Every button and widget hands the visitor over to the WhatsApp app or WhatsApp Web. If you want a conversation that stays inside your page, that is a live chat tool, not WhatsApp, and our guide to adding live chat to your website covers that option.

Muhammad Usman, Founder of Apex Web Expert
Muhammad Usman
Founder, Apex Web Expert

Muhammad Usman designs and builds high-converting websites for small businesses — and writes practical guides like this one from real project experience.

Share this guide:

Keep Reading

Need a Website That Actually Performs?

Fixed pricing, professional build, live in weeks. Tell us about your project — free strategy call, no pressure.