What is a WhatsApp widget for website?
A WhatsApp widget for website is a floating chat button that sits in the corner of your website. When a visitor clicks it, WhatsApp opens directly - on mobile it launches the app, on desktop it opens WhatsApp Web - with a pre-filled welcome message ready to send. The visitor starts a conversation with your number in one tap, from any page of your site.
This generator creates the embed code for a free WhatsApp chat widget that you paste once into your site's HTML. No plugin subscription, no monthly fee, no third-party platform required. The widget is lightweight and loads asynchronously, so it adds no visible impact to your page speed.
When visitors click the button and start conversations, those inbound chats need to be handled - ideally by your whole team, not just one person's phone. Roklo's shared WhatsApp inbox puts every conversation from your widget in one place your team can see, pick up, and follow through on, with full chat history and instant reassignment between team members.
What you can customise
| Setting | What it controls | Example |
|---|---|---|
| Phone number | The WhatsApp number visitors connect to when they click | +91 98765 43210 |
| Button text | The label on the floating button | Chat with us / Talk to sales / Book now |
| Welcome message | Pre-filled text that appears in the visitor's WhatsApp message box when they open the chat | Hi, I visited your website and have a question about... |
| Position | Where the button sits on the screen | Bottom right (default) or bottom left |
| Platform | The code format generated for your site | Plain HTML, WordPress, Shopify, React, Next.js |
How to add WhatsApp to your website
- Configure your widget. Enter your WhatsApp phone number with country code. Set the button text your visitors will see. Write a short welcome message that appears pre-filled in their chat box. Choose the button position - bottom right is the standard and most visible placement.
- Choose your platform and copy the code. Select your platform tab: HTML for any standard website, WordPress for theme-based sites, Shopify for e-commerce stores, or React and Next.js for JavaScript frameworks. Click Copy to copy the generated embed code.
- Paste the code into your site. For HTML and WordPress: paste the code just before the closing body tag of your page or in your theme's footer. For Shopify: add it in the theme.liquid file before the closing body tag. For React and Next.js: use the component or Script snippet as shown in the generated code.
- Save and publish. The floating WhatsApp button appears immediately on your site. Test it by clicking the button and confirming it opens a chat with the correct number and welcome message on both mobile and desktop.
Platform-by-platform installation
| Platform | Where to paste the code | Technical skill needed |
|---|---|---|
| HTML website | Paste before the closing </body> tag in your HTML file | Basic - anyone can do it |
| WordPress | Appearance โ Theme Editor โ footer.php, or use a header/footer plugin | Basic - no coding knowledge needed |
| Shopify | Online Store โ Themes โ Edit Code โ theme.liquid โ before </body> | Basic - takes under 2 minutes |
| Wix | Site Settings โ Custom Code โ Add code in the body section | Basic - no developer needed |
| Squarespace | Settings โ Advanced โ Code Injection โ Footer | Basic |
| React | Import the generated component into your App.js or layout component | Developer - requires basic React knowledge |
| Next.js | Use the Script component from next/script in your _app.js or layout.js | Developer - requires Next.js knowledge |
Where a WhatsApp widget makes the biggest difference
- E-commerce stores - Visitors with questions about sizing, availability, or shipping abandon carts when they cannot get an instant answer. A WhatsApp button for website gives them a direct line before they leave.
- Real estate agencies - Property buyers want to ask specific questions about a listing immediately. A widget on each property page converts browsers into enquiries faster than a contact form.
- Clinics and healthcare - Patients looking for appointment availability or specific service information are high-intent visitors. A visible WhatsApp button removes the hesitation of filling out a form.
- Coaching institutes and EdTech - Parents and students researching admissions want quick answers on fees, batches, and schedules. Instant WhatsApp access converts more visitors during peak admission season.
- Travel agencies - Itinerary questions, package pricing, and booking confirmations all convert better when the visitor can ask on WhatsApp immediately rather than waiting for an email response.
- Salons and service businesses - Visitors on your booking page who have a specific question about availability or service options are one message away from becoming a confirmed appointment.
Why add a WhatsApp widget to your website
- WhatsApp has over 2 billion active users. For Indian businesses, it is the most-used communication app among your customers. Meeting them on the platform they already use reduces friction in every step of the buying decision.
- Response rate on WhatsApp is significantly higher than email or web forms. A customer who messages you on WhatsApp is already in a conversation-ready mindset. Email requires them to wait. WhatsApp expects a reply today.
- Mobile visitors convert better through WhatsApp. On mobile, clicking the widget opens the WhatsApp app directly. There is no form to fill, no page to load, no email to check. One tap, one conversation.
- The welcome message qualifies intent immediately. A well-written pre-filled message ("Hi, I want to know about your pricing for...") tells your team why the visitor reached out before the conversation even starts, so the first reply is relevant, not generic.
- It works 24 hours a day. Visitors browse outside business hours. The widget captures their intent at the moment they are ready to act. With an auto-reply or a team inbox, no enquiry falls through overnight.

