Guides

How to Add an AI Chatbot to Your WordPress Site in 5 Minutes

Three ways to add an AI chatbot to WordPress: a header-and-footer plugin, the theme editor, or a block theme. Copy, paste and publish.

By InfiBot team · · 2 min read

How to Add an AI Chatbot to Your WordPress Site in 5 Minutes

TL;DR: Copy your chatbot's one-line embed code, paste it into your site's footer with a header-and-footer plugin, and save. The chatbot appears on every page. No special WordPress plugin is required.

Before you start

You need:

<script src="https://infi.bot/embed/infi-bot.js" data-bot-key="YOUR_BOT_KEY"></script>
  • Admin access to WordPress.

Method 1: A header and footer plugin (recommended)

This is the safest method, because theme updates won't remove your code.

  1. Go to Plugins → Add New and install a code-snippet plugin such as WPCode.
  2. Open the plugin's Header & Footer screen.
  3. Paste the embed code into the Footer box.
  4. Click Save.
  5. Open your website in a private window and check the chat button appears.

Method 2: The theme file editor

Use this only if you are comfortable editing theme files, and preferably with a child theme.

  1. Go to Appearance → Theme File Editor.
  2. Open footer.php.
  3. Paste the code just before </body>.
  4. Click Update File.

A parent theme update will overwrite this change, which is why Method 1 is better.

Method 3: Block themes (Full Site Editing)

  1. Go to Appearance → Editor → Patterns → Footer.
  2. Add a Custom HTML block.
  3. Paste the embed code and save.

Show the chatbot on some pages only

With WPCode you can set display rules, for example only on service pages, or hide it on checkout.

Troubleshooting

Problem Fix
Chat button not showing Clear your caching plugin and CDN cache
Button shows but no answers Check the bot key matches your bot
Appears twice Remove the code from one of the places you added it
Hidden behind other widgets Change the widget position in your bot's appearance settings

Frequently asked questions

Does the chatbot slow down WordPress?

The script loads asynchronously, so it doesn't block your page content.

Does it work with Elementor and Divi?

Yes. Use Method 1, or the builder's own custom code area.

Can it capture WooCommerce leads?

Yes. Leads are delivered to email, Google Sheets or a webhook, separately from WooCommerce orders.