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

TL;DR: To add an AI chatbot to WordPress in about 2 minutes, copy your bot's embed code and paste it before the closing body tag in footer.php, or use the Insert Headers and Footers plugin so you never touch theme files. Elementor, Divi, and Gutenberg each have an HTML block for the same snippet. Clear your caching plugin and CDN afterwards, then verify in an incognito window.
WordPress powers over 40% of websites worldwide, making it the most common platform for AI chatbot deployment. Here's exactly how to add an AI chatbot to your WordPress site.
Method 1: Theme Header/Footer (Recommended)
This is the simplest method and works with every WordPress theme.
Step 1: Get Your Embed Code
Log into your chatbot platform dashboard and navigate to your bot's "Install" tab. Copy the embed code - it looks something like this:
<script src="https://chatonbo.com/widget/chatonbo-widget.js"
data-bot-id="your-bot-id"
data-api-url="https://chatonbo.com/api">
</script>Step 2: Add to WordPress
Go to Appearance → Theme File Editor (or Appearance → Theme Header/Footer if your theme supports it).
Find the footer.php file and paste the embed code just before the closing


