Add a WhatsApp button to WordPress
WordPress gives you three routes and you do not need a plugin for any of them: a Custom HTML block for a button in a specific post or page, a widget area for something in the sidebar or footer, or the theme footer for a floating bubble on every page.
One small script tag. Renders a floating bubble with a mini chat panel.
Without the country code and without a leading zero.
The free hosted widget shows a small “by Galantis” badge.
Preview
Hi there! 👋 How can we help?
Chat on WhatsAppYour snippet
Enter your WhatsApp number to get your link.
Paste this anywhere your platform accepts custom HTML.
These steps work on the block editor (Gutenberg) and on classic themes. If you are on a page builder like Elementor or Divi, use its HTML/Code widget and paste the same snippet.
Install it on WordPress, step by step
- Build your snippet above. Pick button or floating widget, set your number and welcome message, and copy the snippet.
- For a button in one page or post. Edit the page, click the + to add a block, search for "Custom HTML" and paste your button code into it. Preview to check it renders, then update the page. 📸 Screenshot placeholder — 1600×900, step number 2 burned into the top-left.
Must show: WordPress block editor with the Custom HTML block inserted and code pasted - For a button in the sidebar or footer. Go to Appearance → Widgets, add a Custom HTML widget to the widget area you want, paste the snippet and save. 📸 Screenshot placeholder — 1600×900, step number 3 burned into the top-left.
Must show: Appearance → Widgets screen with a Custom HTML widget added to the footer area - For the floating widget on every page. The safe route is a code-snippets plugin or your child theme. In a child theme, add the script to footer.php just above </body>. With a snippets plugin, create a new snippet set to run in the site footer and paste the script there. 📸 Screenshot placeholder — 1600×900, step number 4 burned into the top-left.
Must show: Theme file editor showing footer.php with the script above the closing body tag - Clear your cache and test. If you run a caching plugin or a CDN, purge the cache, then load the site in a private window and tap the button on a phone.
What usually goes wrong
- Never edit a parent theme directly — the next theme update overwrites it. Use a child theme or a snippets plugin.
- Some security plugins strip <script> tags from post content. If the widget does not appear, that is usually why; put it in the footer instead.
- Caching plugins are the number one reason "it worked in preview but not live". Purge before you debug anything else.
Frequently asked questions
Do I need a WhatsApp plugin?
No. A plugin adds a settings screen and an update surface for something that is one line of HTML. The snippet above does the same job without the maintenance.
Will it work with Elementor or Divi?
Yes. Both have an HTML or Code widget — drop it where you want the button and paste the snippet. For the floating widget, the site-wide footer route is still cleaner.
Does it need a cookie banner?
No. The widget sets no cookies, uses no storage and tracks no visitors, so there is nothing to consent to.