How to add a WhatsApp button to your website (and WordPress)
A lightweight floating chat button turns hesitant visitors into conversations. Generate the code, install it on WordPress, Shopify or any HTML site, and test it.
Many visitors leave a website because one small question is left unanswered: “Do you deliver to my city?”, “Is this size in stock?”, “Can I book for tomorrow?”. A WhatsApp chat button in the corner of your pages lets them ask instantly, in the app they already use all day. For local businesses, e-commerce and service providers, it is often the highest-converting contact method on the site.
This guide explains how to create a fast, privacy-friendly button and install it on WordPress, Shopify, Wix, Squarespace or a hand-coded site.
Plugin or code snippet?
WordPress has dozens of WhatsApp plugins. They are convenient, but many load extra JavaScript and CSS on every page, add tracking, show upsell banners in your dashboard or lock basic options behind a paid plan. A small code snippet does the same job with almost no impact on speed — which matters for SEO and Core Web Vitals.
The free WhatsApp chat button generator produces a self-contained snippet (HTML, CSS and a few lines of JavaScript) with no external requests, no cookies and no tracking.
Step 1: Generate your button
- Open the chat button generator.
- Enter your WhatsApp number with the right country code.
- Write a pre-filled message such as “Hello, I have a question about your website”.
- Choose a label (“Chat with us”) or leave it empty for an icon-only button.
- Pick a color that contrasts with your site, the corner (bottom right is the most common) and the distance from the bottom.
- Enable the greeting popup if you want visitors to see a welcome message and your reply hours before the chat opens.
- Check the live preview, then click Copy code.
Step 2: Install it on WordPress
Option A: a header and footer code plugin (recommended)
- In your dashboard, go to Plugins › Add New and install a lightweight code-snippet plugin such as “WPCode” (or any “Insert Headers and Footers” plugin).
- Open the plugin’s Header & Footer screen.
- Paste the snippet into the Footer box.
- Save and open your site in a private window to check the button.
This method survives theme updates and keeps the code in one place.
Option B: the theme footer
If you use a child theme, you can paste the snippet just before <?php wp_footer(); ?> in footer.php. Avoid editing a parent theme directly: the change will be lost at the next update.
Option C: block themes and page builders
In block themes, open Appearance › Editor › Patterns › Footer, add a Custom HTML block and paste the code. With Elementor or similar builders, use an HTML widget inside the global footer template so the button appears on every page.
Step 3: Other platforms
- Shopify: Online Store › Themes › Edit code, open
layout/theme.liquidand paste the snippet just above</body>. - Wix: Settings › Custom code › Add custom code, choose “All pages” and “Body – end”.
- Squarespace: Settings › Advanced › Code injection › Footer.
- Webflow: Project settings › Custom code › Footer code, then publish.
- HTML or PHP sites: paste the snippet in your shared footer file, just before
</body>.
Step 4: Test on real devices
- On a phone, tap the button: WhatsApp should open on a chat with your number and the pre-filled message.
- On a computer, the link opens a page offering WhatsApp Web or the desktop app.
- Check that the button does not cover your cookie banner, cart button, chat widget or “back to top” arrow. Increase the distance from the bottom if needed.
- Test keyboard navigation: press Tab until the button is focused and press Enter.
Make the button convert better
- Use a specific pre-filled message per page type. On product pages, “I have a question about this product”; on the booking page, “I’d like to check availability”.
- Show reply hours in the greeting popup so visitors know when to expect an answer.
- Answer fast. Set up greeting and away messages in WhatsApp Business and save quick replies from our template library.
- Do not hide it. A visible label like “Questions? Chat with us” often gets more clicks than an icon alone.
- Keep it accessible. Strong color contrast and a clear label help every visitor.
Privacy and GDPR considerations
The snippet itself sets no cookies and sends no data until a visitor clicks. Once they click, they leave your site for WhatsApp, which processes data under its own policy. Mention WhatsApp as a contact channel in your privacy policy, and avoid asking for sensitive information (health data, ID numbers, card numbers) over chat.
Contact button vs share button
A chat button lets visitors message you. If you want visitors to send your page to their friends, use a share button instead — create one with the WhatsApp share link generator. Many blogs and shops use both: a floating contact button and a share button below each article or product.
Summary
Generate a lightweight button with the chat button generator, paste it into your site’s footer (with a header/footer plugin on WordPress), test it on mobile and desktop, and prepare WhatsApp Business to reply quickly. In less than ten minutes, every page of your site gets a direct line to your inbox — without slowing it down.