How to add an AI chatbot to your WordPress site (step by step)
September 30, 2026 · 6 min read
An AI chatbot on your website answers visitors' questions the moment they ask, including at night and on weekends when nobody is at the desk. On WordPress, adding one takes a few minutes. This guide walks through what to prepare, three ways to install it, and how to make sure it gives good answers.
Before you start: what the chatbot needs to know
A modern AI chatbot doesn't follow a script. It reads your content and answers from it. The quality of its answers depends almost entirely on what you give it, so spend five minutes on this first:
- Your website itself. Most tools, Bubagent included, can read your pages automatically.
- Prices, opening hours and contact details, written out plainly (not only inside images).
- Your top ten customer questions and your answers to them. Check your inbox and phone notes for these.
- Policies people ask about: cancellations, refunds, delivery, parking, booking.
Option 1: Use a plugin (easiest)
With a plugin you never touch code:
- Create your agent in your chatbot provider's dashboard and copy its ID.
- In WordPress, go to Plugins → Add New → Upload Plugin, choose the plugin zip, then click Activate.
- Open the plugin's settings page (for Bubagent: Settings → Bubagent), paste the agent ID and save.
- Visit your site in a private browser window. The chat bubble should appear in the corner.
Option 2: Paste the embed code into your theme
Every chatbot gives you a one-line script. Paste it just before the closing </body> tag so it loads on every page. The safest way in WordPress is a header/footer plugin (such as WPCode) rather than editing theme files directly, because theme updates can overwrite your changes.
<script src="https://bubagent.com/widget.js" data-bot-id="YOUR_AGENT_ID" async></script>The async attribute means the chatbot loads in the background, so it won't slow down how quickly your page appears.
Option 3: Page builders (Elementor, Divi, etc.)
Most page builders have a site-wide custom code or footer code setting. Paste the same line there. Avoid adding it inside a single page's HTML widget unless you only want the chatbot on that page.
Test it like a customer would
Before telling anyone, ask it ten real questions, including a few awkward ones:
- The obvious ones: prices, hours, location, how to book.
- Something it shouldn't know, to check it admits it rather than making something up.
- “Can I speak to a person?”, to check it hands off to your phone, email or booking link.
Good chatbots show you the questions they couldn't answer. Check that list weekly for the first month: each answer you add fixes that question for every future visitor.
Common problems
- Chat bubble doesn't appear: clear your caching plugin's cache and your CDN cache, then reload.
- It appears twice: the code was added in two places (e.g. a plugin and the theme). Remove one.
- Answers are out of date: re-sync your website content, or turn on automatic weekly syncing.
Put an AI assistant on your website
Bubagent reads your website and answers customers 24/7. 14 days free, no credit card.
