Blog

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

7 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.

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.

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.

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>.

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).

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 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.

Try it on your own website

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