BotChata
Get started

How to Add an AI Chatbot to WordPress — Step by Step in 5 Minutes

↑ Part of AI chatbot for your website

In short: You create an AI agent in BotChata, let it index your website, and paste a single script tag into WordPress. From then on, the chatbot answers visitor questions around the clock — using only your own site's content, in 40+ languages. No coding. GDPR-compliant, hosted in Germany (EU).

Start free — no credit card · Live in 5 minutes · Free plan forever

What You Need (Prerequisites)

Note on WordPress.com: pasting script tags is only possible on the Business plan or higher. On self-hosted wordpress.org, it works on any theme.

Part 1 — Set Up BotChata (about 3 minutes)

Step 1: Create an agent and add your site

Sign up at botchata.net and open the dashboard. On Add a new site, enter a Site name and your Website URL, then click Add & start indexing. The crawl begins automatically.

Add a new site — name and website URL

The free start needs no credit card — just your email. (You can optionally activate the 7-day Premium-features trial later with a card; not needed for this guide.)

Step 2: Let it finish indexing

BotChata reads every reachable page and turns it into the knowledge base. For ~50 pages this takes 1–3 minutes. On the Links tab you see every page it crawled with an Indexed status — wait until the site shows Ready.

Links tab — all pages indexed

Why this matters: the bot answers only from your indexed content. If an answer isn't on your site, it says so honestly — instead of making something up. That protects your credibility.

To add another source later (a second domain or a single page), click Add link and choose 🌐 Full site or 📄 Single page.

Add source — Full site vs Single page

Step 3: Quick test

Open the Overview tab and ask the bot a few typical customer questions in the live preview (e.g. "How much is shipping?"). If the answers are accurate, you're ready to embed.

Overview tab — live chat preview

Step 4: Copy the embed code

Open the agent's Widget tab and switch to the Script section. Copy the snippet next to Embed code — it looks like this:

Widget → Script — embed code with a Copy button

<script
  src="https://botchata.net/api/widget.js"
  data-api-key="YOUR_KEY"
  data-api-url="https://botchata.net/api"
  defer
></script>

The defer attribute makes the widget load asynchronously so it won't slow down your load time (Core Web Vitals). The widget runs in an isolated Shadow DOM — it can't interfere with your theme's design.

Part 2 — Add the Code to WordPress (about 2 minutes)

You have three ways. Method A is best for most people — no code, update-safe.

✅ Method A (recommended): via a header/footer plugin — no code

This method survives theme updates and needs zero programming.

  1. In the WordPress admin: Plugins → Add New.
  2. Search for WPCode (formerly "Insert Headers and Footers"), install and activate it.
  3. Go to Code Snippets → Header & Footer.
  4. Paste the copied BotChata script into the Footer box.
  5. Save. Done.

Why "Footer" and not "Header": the script belongs just before the closing </body> tag — so the page loads first, the widget after.

Method B: block theme via the Site Editor

If you use a modern block theme (e.g. Twenty Twenty-Four/Twenty Twenty-Five), it works without a plugin too:

  1. Open Appearance → Editor.
  2. Select Templates → Footer (or the template shown on all pages).
  3. Add a Custom HTML block at the end and paste the script.
  4. Save.

Method C: manually in footer.php (for developers)

Only if you deliberately edit theme files — and ideally in a child theme, otherwise the change is lost on the next theme update.

  1. Appearance → Theme File Editor.
  2. Open footer.php.
  3. Paste the script directly before </body>.
  4. Update File.

⚠️ Editing theme files directly is error-prone and not update-safe. When in doubt, use Method A.

Step 3 — Check That It Works

  1. Open your site in a new private/incognito window.
  2. The BotChata bubble appears in the bottom-right.
  3. Click it and ask a real question about your offering.
  4. The bot should answer within seconds with content from your website.

See the widget? You're live. 🎉

GDPR Note

Common Problems (Troubleshooting)

ProblemFix
The widget doesn't appear.Clear cache (browser and caching plugin like WP Rocket/LiteSpeed). Check the script is really in the footer (re-save Method A).
The bot answers "I don't know".That page may not be indexed. In BotChata, check the Links tab and reindex (one click).
The widget clashes with the design.The Shadow DOM should prevent this. If it still happens, adjust position/z-index in the Widget Builder (Business plan and up).
Answers in the wrong language.BotChata auto-detects the visitor's language (40+ languages). Test with a question in a fresh window.
I'm on WordPress.com and see no code field.Script embedding is available from the Business plan on WordPress.com. On self-hosted wordpress.org, every method works.

FAQ

Does BotChata need a WordPress plugin? No. A single script tag is enough. A header/footer plugin (Method A) is just the easiest, code-free way to insert that tag — it's not required.

Is this GDPR-compliant? Yes. Hosted in Germany (Hetzner), DPA included, no AI training on your data, and controllable via your consent tool. See the GDPR note above.

Does the bot make up answers? No. It answers only from your indexed website content. If information is missing, it says so honestly instead of guessing.

What does it cost? The free start costs $0 (100 messages/month, sign up with no card). Paid plans start at $29/month — a fixed price per plan, no per-message credits.

Does it work with WooCommerce / Elementor / a page builder? Yes. The script loads site-wide via the footer and is independent of your theme or page builder. For WooCommerce-specific features (order status, shipping) there are additional integrations.

Will the widget slow down my site? No. It loads asynchronously (defer) in an isolated Shadow DOM and doesn't block your page from rendering.

Start Now

Add an AI chatbot that knows your content to your WordPress site in 5 minutes.

Start free — no credit card

Set up in 5 minutes. 100 messages/month free. GDPR-compliant, hosted in Germany.