chatty4allBuild your assistant

How to add an AI chatbot to WordPress

Updated · 3 min read

WordPress doesn't need a special chatbot plugin for Chatty4All. The chatbot is one line of code, and WordPress gives you two easy places to put it: your theme's footer, or a free header & footer code plugin if you'd rather not touch theme files.

Before you start

  1. Build your assistant in the Chatty4All editor: pick a design, then teach it about your business.
  2. Under Go live → Websites it may run on, add your website's address. The assistant only loads on the sites listed there, so nobody can copy your code onto theirs.
  3. Publish it. The editor then shows your code with your own assistant id in place of YOUR_BOT_ID.

Your code

This is the whole install. Copy yours from Go live in the editor: it's the same line with your id filled in.

HTML
<script src="https://chatty4all.design/widget.js" data-bot="YOUR_BOT_ID" async></script>

Add it to WordPress

  1. In WordPress, go to Appearance → Theme File Editor → footer.php (or use a plugin like “WPCode” → Header & Footer).
  2. Paste the line into the footer section.
  3. Save — the assistant shows up across your site.

Tips for WordPress

  • A code plugin such as WPCode keeps the line when you update or switch themes. A line pasted into footer.php is lost if the theme is updated or replaced, unless you use a child theme.
  • If your site uses a caching plugin, clear its cache after saving so visitors get the new page.
  • On WordPress.com, adding code needs a plan that allows plugins or custom code. If you don't see the option, check your plan.

Showing the chat inside a page instead

For the in-page (Inline) layout, add a Custom HTML block where the chat should appear on that page and paste the line there, instead of in the footer.

Check it worked

  • Open your live site in a private window. The chat button should appear in the corner within a few seconds.
  • If it says it isn't enabled for this site, add that exact domain under Go live → Websites it may run on.
  • If nothing appears, check that you published the assistant and that the line is on the page (view the page source and search for widget.js).

Would you rather let your AI coding assistant do it? See install the chatbot with Cursor, Claude, Lovable, v0 or Bolt.