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
- Build your chatbot. Open RagmyAI (the web app or the Android app), sign in and tap Build chatbot.
- 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.
- Set its personality. In Custom Instructions, describe its tone and the rules it always follows.
- Give it a short link. Tap Edit chatbot link and use your brand name, like
chat.ragmyai.com/yourshop. - 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)
- Go to Appearance > Editor > Patterns (or Template parts) and open Footer.
- Add a Custom HTML block inside the footer, paste your script tag and click Save.
- 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)
- Go to Plugins > Add New Plugin, search for WPCode ("Insert Headers and Footers"), install and activate it.
- Go to Code Snippets > Header & Footer, paste your script tag into the Footer box and click Save Changes.
- 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)
- Open a page such as Contact or Help and add a Custom HTML block.
- 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
- Voice needs https. Browsers only allow the microphone on secure pages. Live sites almost always use https; a local test site on http won't allow voice.
- On phones, the button opens the chatbot full screen, which is easier to use on a small screen.
- Customize the button with optional attributes on the script tag, like
button-background-color="#1F4FD8"orwidget-height="600px". Leave them out to keep the default look. - WordPress.com free plans remove scripts and iframes. There, add a Buttons block or menu link to your chatbot link, set to open in a new tab.
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.