← Back to blog · How-to guide · 5 min read

How to Add an AI Chatbot to WordPress (Free, With Voice, No Plugin)

Train a chatbot on your own content and give your WordPress site a floating chat button that visitors can type or talk to. Here are 3 ways, including one with no plugin.

RA
RagmyAI Team
Dec 4, 2026 · 5 min read
How to Add an AI Chatbot to WordPress (Free, With Voice, No Plugin)

Quick answer: paste RagmyAI's script tag into a Custom HTML block in your Footer template part (block themes, no plugin), or into the WPCode plugin's footer box (any theme). A floating chat button appears on every page, and voice works on https sites.

Step 1: Create and train your chatbot

  1. Build your chatbot. Open RagmyAI (the web app or the Android app), sign in and tap Build chatbot.
  2. Train it. Tap Train chatbot, then Website Link to learn from your site. Use Upload Document for PDF, DOCX, TXT or HTML files, and Text Input for short facts like prices or opening hours.
  3. Set its personality. In Custom Instructions, describe its tone and the rules it always follows.
  4. Give it a short link. Tap Edit chatbot link and use your brand name, like chat.ragmyai.com/yourshop.
  5. Copy the code. On the Build chatbot screen, choose Script Tag for a floating chat button, or Iframe Tag for a chat panel inside a page, then tap Copy embed code.

Step 2: Add it to WordPress (pick one)

The script tag looks like this:

<script defer
  data-page-id="yourshop"
  src="https://chat.ragmyai.com/chat-widget.min.js">
</script>

Way 1: Footer template part (block themes, no plugin)

  1. Go to Appearance > Editor > Patterns (or Template parts) and open Footer.
  2. Add a Custom HTML block inside the footer, paste your script tag and click Save.
  3. Open your site: the chat button appears in the bottom-right corner of every page.

No Appearance > Editor? Your theme is a classic theme, so use Way 2.

Way 2: WPCode plugin (any theme)

  1. Go to Plugins > Add New Plugin, search for WPCode ("Insert Headers and Footers"), install and activate it.
  2. Go to Code Snippets > Header & Footer, paste your script tag into the Footer box and click Save Changes.
  3. Check the chat button on a few pages.

This is the safest choice if you change themes often, because the code stays in the plugin.

Way 3: Iframe in a Custom HTML block (chat panel on one page)

  1. Open a page such as Contact or Help and add a Custom HTML block.
  2. Paste your iframe code, then click Update or Publish.
<iframe
  src="https://chat.ragmyai.com/yourshop"
  allow="microphone"
  width="100%"
  height="600">
</iframe>

Our recommended setup: Way 1 or Way 2 for the floating button on every page, plus Way 3 on your Contact page if you want the chat open there.

Good to know

FAQ

Do I need a plugin to add a chatbot to WordPress?

No. On block themes, paste the script tag into a Custom HTML block in your Footer template part. On classic themes, the free WPCode plugin is the easiest way.

Does voice work on WordPress?

Yes, on sites that use https. Visitors can tap the mic in the chat window and talk to your chatbot.

Can I add a chatbot on WordPress.com?

On free WordPress.com plans, scripts and iframes are removed, so add a button or menu link to your chatbot link instead. The floating button needs a plan that allows plugins.

Is it free?

Yes. Building your chatbot, training it and sharing its link are free on RagmyAI. Paid plans add more models and higher limits.

Using another website builder? See our guides for Google Sites, Wix and Shopify, or try a live chatbot demo first. For any other site, see all the ways to embed a chatbot in your website free.

Add a chatbot to your WordPress site today.

Free plan, no credit card. Train it on your website and documents in minutes.

Start free

Keep reading

More from the blog.