WordPress Chatbot: Plugin or Script Tag?
Most WordPress chatbots come as plugins, but a chatbot doesn't need to run inside WordPress at all. Here's how the two compare on security, speed and upkeep.
Published Updated 5 min read
For most WordPress sites, a chatbot added as a single script tag is the simpler and lower-risk choice. A chatbot plugin can be perfectly fine, but it runs code inside your WordPress install, needs updates, and adds to the part of WordPress where most security problems live. A script tag runs in the visitor's browser and on the vendor's servers, and WordPress only has to print one line.
I build ChatBento, which deliberately isn't a plugin, so I'm biased toward the script tag. I'll lay out the trade-offs fairly, including when a plugin is the better choice.
What's the actual difference?
A chatbot plugin is PHP code that runs on your server every time WordPress builds a page. It usually adds settings screens to your admin, may create database tables, and often also loads JavaScript for the chat bubble. It has the same access to your site as any other plugin.
A script tag chatbot is one line of HTML in your footer, like this:
<script src="https://chatbento.com/widget.js" data-bot-id="YOUR_BOT_ID" async></script>
WordPress doesn't run it. The visitor's browser loads it, and the chat itself talks to the vendor's servers. Your WordPress install doesn't know or care what the chatbot does.
Why plugins are where WordPress security problems live
Patchstack, which tracks WordPress vulnerabilities, reported in its State of WordPress Security in 2026 that 11,334 new vulnerabilities were found in the WordPress ecosystem in 2025, a 42% increase on 2024. 91% of them were in plugins and 9% in themes. WordPress core had only 6, all low priority.
Two more figures from the same report are worth knowing:
- 46% of vulnerabilities didn't get a fix from the developer in time for public disclosure.
- For the most heavily targeted vulnerabilities, the weighted median time to first exploit was 5 hours.
None of that means chatbot plugins are unusually risky. Plenty are well built and well maintained. It means every plugin you add is more code with access to your site that someone has to keep patched, and the ecosystem's numbers say that doesn't always happen in time.
How they compare
| Chatbot plugin | Script tag | |
|---|---|---|
| Runs on your server | Yes (PHP) | No |
| Access to your WordPress database and admin | Same as any plugin | None |
| Needs updating in WordPress | Yes | No: the vendor updates the script |
| Survives theme changes | Yes | Depends where you paste it (see below) |
| Works with Elementor, Divi, Gutenberg | Usually | Yes, it sits outside the builder |
| Settings live in | Your WordPress admin | The vendor's dashboard |
| Can read your posts | Directly from the database | By crawling your published pages |
When a plugin is the better choice
To be fair to plugins, there are cases where one makes more sense:
- You need WordPress-specific data. For example, a bot that answers from members-only content, or from WooCommerce data that isn't on any public page. A script that crawls public pages can't see those.
- You want everything managed in one admin. Some site owners prefer every tool's settings inside WordPress. That's a reasonable preference.
- Your client shouldn't need a second login. If you build sites for others, a plugin can keep things in one place for them.
If you go with a plugin, choose like you'd choose any plugin: recent updates, an active developer, a reasonable number of installs, and no unpatched issues listed in a vulnerability database. And remove it completely if you stop using it. Deactivated plugins still sit in your files.
How to add a script tag in WordPress
You have three practical options. Pick the one that fits how your site is built.
Option 1: A header and footer code plugin (easiest)
Yes, this is a plugin, but it's a general-purpose one you may already have, and it does one job: print your snippet in the footer.
- In WordPress, go to Plugins → Add New and install a header and footer code plugin such as WPCode.
- Open its Header & Footer settings.
- Paste the snippet into the Footer box and save.
- Clear your cache if you use a caching plugin.
Option 2: Your theme's footer (no extra plugin)
Paste the snippet just above </body> in your theme's footer.php. Use a child theme, or the change disappears the next time the theme updates. If you're not comfortable editing theme files, use option 1.
Option 3: Block themes and the Site Editor
On a block theme, you can add a Custom HTML block to your footer template part in Appearance → Editor and paste the snippet there. Because the footer appears on every page, so does the chatbot. Some setups strip script tags from blocks, so check the published page afterwards. If the bubble doesn't appear, use option 1.
Whichever you pick, test on the live site, not the editor preview.
Two things that trip people up
Caching. Caching plugins can keep serving the version of your pages from before you added the snippet. Clear the cache after adding it.
"Delay JavaScript" settings. Speed plugins often delay scripts until a visitor scrolls or clicks. That can make the chat bubble appear late or not at all on short visits. Exclude the chatbot's script from that setting.
What about speed?
A script tag isn't automatically fast, and a plugin isn't automatically slow. What matters is how much JavaScript loads on the front end and when. Look for:
asyncordeferon the script, so it doesn't block your page from rendering.- A small file. ChatBento's widget is about 6 KB compressed.
- No layout shift. A fixed-position chat bubble shouldn't push your content around when it appears.
The honest test is your own site: run PageSpeed Insights before and after you install any chatbot and compare.
The short checklist
- Decided: does the bot need private WordPress data (plugin) or just public pages (script tag)?
- If a plugin: recently updated, actively maintained, no open vulnerabilities
- If a script tag: added via footer code plugin, child theme or footer template part
- Cache cleared after installing
- Chat script excluded from "delay JavaScript" settings
- Tested on the live site and on a phone
- PageSpeed checked before and after
The full steps, including where the snippet goes, are in the WordPress install guide. ChatBento works with any theme or page builder and has a free plan, so you can try it without adding anything to your WordPress install beyond one line.