Blog

How to Add an AI Chatbot to WordPress (10 Minutes, No Coding)

6 min readBy the ButtarAI team

Adding an AI chatbot to WordPress used to mean installing a heavy plugin, configuring dozens of rigid rules, and hoping it doesn't break your theme on the next update. There's a simpler way: a single script tag. Here's exactly how to do it with ButtarAI — most site owners finish in under 10 minutes.

What you'll need

  • A WordPress site where you can install plugins (any self-hosted site, or WordPress.com Business and above).
  • A free ButtarAI account — sign up here (15-day trial, no credit card).
  • About 10 minutes.

One decision before you start: script tag vs native plugin. A native chatbot plugin runs inside WordPress — PHP on your server, database queries, and updates to manage forever. A script-tag chatbot like ButtarAI loads asynchronously from outside WordPress and does nothing until a visitor opens the chat. It is faster, can't break your theme, and never needs a plugin update. That is the method this guide uses. If you are still comparing options, see 7 best chatbots for WordPress.

Step 1: Create and train your chatbot

  1. Log in to your ButtarAI dashboard and click Create chatbot.
  2. Give it a name (your business name works well) and enter your website URL.
  3. Click crawl — ButtarAI reads your public pages, posts and FAQs and builds a knowledge base. This usually takes a minute or two.
  4. Review the knowledge sources, add any extra FAQs or custom text (pricing, policies, contact details), then continue.
  5. Customize the appearance: upload your logo, pick your brand color, choose bottom-left or bottom-right, and write a friendly welcome message.

Your chatbot now answers from your content. If a visitor asks something it doesn't know, it replies with your fallback message instead of guessing — you can add the missing info later in seconds.

Tip: spend two extra minutes on the welcome message. A specific opener ("Ask me about our plans, delivery times, or bookings") gets far more engagement than a generic "Hi, how can I help?" because it tells visitors what the chatbot is good at.

Step 2: Copy your embed snippet

Open your chatbot and go to the Install tab. You'll see a snippet like this:

<script src="https://buttarai.online/widget.js"
  data-bot-id="YOUR_BOT_ID" async></script>

Copy it. That's the only code you'll ever touch.

Step 3: Add it to WordPress with WPCode

The most reliable method uses the free WPCode plugin:

  1. In wp-admin, go to Plugins → Add New and install WPCode – Code Snippets. Activate it.
  2. Go to Code Snippets → Add Snippet → Add Your Custom Code.
  3. Choose HTML Snippet, paste your ButtarAI snippet, and name it “ButtarAI Chatbot”.
  4. Under Insertion → Location, choose Site Wide Footer.
  5. Set the snippet to Active and save.

Visit your site in an incognito window — the chat button should appear in the corner you chose. Click it and ask a question about your business to test.

Why WPCode rather than editing theme files? Your snippet survives theme updates and switches. Code pasted directly into a theme's footer.php vanishes the next time the theme updates — unless you maintain a child theme.

Alternative methods

  • Elementor: Elementor → Custom Code → add the snippet, set location to </body> – End.
  • Custom HTML block: edit your footer template in the Site Editor and add a Custom HTML block with the snippet.
  • Child theme: paste the snippet in footer.php just before </body>.

Testing checklist

Before you call it done, run through these:

  1. Incognito test: open the site in a private window and confirm the chat button appears in the right corner.
  2. Ask a real question: type something a customer would actually ask — pricing, hours, delivery — and check the answer is accurate.
  3. Ask something it shouldn't know: confirm it uses your fallback message instead of inventing an answer.
  4. Mobile check: open the site on your phone; the chat should open as a full-screen panel that is easy to read and type in.
  5. Dashboard check: confirm the test conversation appears in your ButtarAI dashboard history.

Troubleshooting

The button doesn't appear

  • Clear any caching plugin (WP Rocket, LiteSpeed Cache, etc.) and hard-refresh (Ctrl+Shift+R).
  • Make sure the snippet is the https version — browsers block http scripts on https sites.
  • Check your browser console for errors from other plugins.

The chat says “domain not allowed”

In your ButtarAI dashboard, open the chatbot → Overview →Allowed domains and add your site's domain (without https://, e.g. yoursite.com).

The widget appears on some pages but not others

Check the WPCode snippet's insertion rules — make sure location is Site Wide Footer with no page exclusions. Some caching setups also serve stale pages; purge the cache after saving.

What to do next

  • Read your first conversations in the dashboard — they show you exactly what visitors ask.
  • Add the questions it couldn't answer as FAQs to make it smarter.
  • Set up lead capture: decide which details (name, email, phone) the chatbot should ask for.

The highest-value habit is a weekly 10-minute review: open the transcript list, note every question the chatbot couldn't answer, and add those answers to your FAQs. Each cycle makes the chatbot measurably better, and the gaps it reveals often point to missing content on your site itself.

The whole point: your WordPress site now answers visitors at 2am, on weekends, and during holidays — without a plugin to update or a single line of PHP.

FAQ

Will this slow down my WordPress site?

Practically no. The script loads asynchronously and the widget fetches nothing until a visitor opens the chat — far lighter than a native chatbot plugin running PHP on every page load.

Does it work with page builders like Elementor or Divi?

Yes. Because the chatbot is a site-wide script rather than page content, it works regardless of which builder made the page. Use the Elementor Custom Code method above if you prefer keeping everything inside Elementor.

What about WordPress multisite?

Install WPCode at the network level or per site, and create one ButtarAI chatbot per site (or share one if the sites share content). Each chatbot has its own embed snippet and allowed domains.

Can I control which pages show the chatbot?

Yes — WPCode lets you set conditional logic per snippet (show only on certain pages, post types, or for logged-out visitors). Most businesses show it site-wide, but hiding it on checkout or account pages is a common choice.

Related reading: How to Add an AI Chatbot to Your Website — the general guide covering Shopify, custom HTML and any platform.

Related reading: AI Chatbot Builder: What It Is and How to Choose the Right One — the evaluation checklist, for when you are comparing builders.

Related reading: Chatbot Plugins for WordPress: How to Choose the Right One in 2026 — the four plugin types, the plugin-vs-script trade-off, and the checklist to run before installing.

Try it on your own website

Create a free ButtarAI chatbot trained on your content — live in minutes, no credit card required.