How to add a chatbot to a WordPress website: two routes
To add a chatbot to a WordPress website, install the chatbot's WordPress plugin, or paste its embed script into your theme's head or before the closing body tag. The plugin route needs no code; the script route means pasting a snippet.
These steps assume self-hosted WordPress. On WordPress.com, plugin installs and header code are limited to the Personal, Premium, Business and Commerce plans, so a free WordPress.com site cannot use either route until it upgrades.
We may earn a commission if you buy through links on this page, at no extra cost to you.
Try DocsBot free →Route 1: install the chatbot's WordPress plugin
- In the dashboard, open Plugins > Add New and search by keyword, author or tag.
- Click Install Now, then Activate. The plugin is not on until you click Activate.
- If the plugin is not in the directory, click Upload Plugin at the top of the same screen, choose the vendor's ZIP file and click Install Now.
- Open the plugin's settings, connect your chatbot account and pick the bot to show.
DocsBot's WordPress plugin adds its chat widget without code on WordPress 6.5 or newer and lets you include or exclude page paths such as /docs/. It needs a DocsBot account and API key, and DocsBot documents no plan gate for it. Other tools are compared in best AI chatbot builder for website.
Route 2: paste the embed script into the theme
Use this route when the chatbot has no WordPress plugin. Copy the embed code from the bot's page in the vendor's dashboard; DocsBot's goes in the head or anywhere before the closing body tag. A header-and-footer snippet plugin keeps it out of your theme files. WordPress.com's own guide uses the free WPCode plugin (Insert Headers and Footers): open Code Snippets, then Header & Footer, and paste into the Header or Footer box, where it loads on every page.
Avoid pasting into the Theme File Editor. WordPress says the editor makes no backup copies and that a theme update erases the changes; a child theme avoids the second problem.
For a floating button, the script alone is enough. To place the chat inside one page, add an element with the id docsbot-widget-embed and include the script and element on that page only; without the element the widget mounts as a floating button. In the widget settings, restrict the domains it can run on, adding each subdomain separately.
Check the chatbot on a phone and on the right pages
Open a page where the widget should appear on a phone and confirm it opens the right bot without covering page content, then open one where it should not appear. With audience rules, test a visitor who is eligible and one who is not. If the widget is missing, check the enable switch (Deploy, in DocsBot) and the include and exclude rules, then clear WordPress, CDN and browser caches and retest in a private window.
DocsBot's path rules control placement, not access, so use a login or role rule for private pages. Its widget shows source links unless hideSources is set, giving readers a way back to the source article.
DocsBot's documentation says nothing about its widget's keyboard or screen-reader behavior, so run these W3C WCAG 2.2 checks, each of which has exceptions, on any chatbot you add:
- Keyboard: everything in the widget works without a mouse (2.1.1).
- Phone width: usable at 320 CSS pixels wide without two-way scrolling (1.4.10).
- New answers: announced to assistive technology without moving focus (4.1.3).
- Touch: targets at least 24 by 24 CSS pixels (2.5.8).
Which chatbot to add to WordPress
Compare chatbots on whether they sync from your site, how you can start and the entry price. The DocsBot review lists every DocsBot plan and limit.
DocsBot's Free plan, for personal use and with no credit card, includes 1 bot and 50 source pages, enough to build a first test bot from a few public pages before you add any plugin. A site with a few pages and a search box that already answers visitors may need no chatbot at all.
Sources used for this page
The facts above come from the pages below, read on October 14, 2026. Prices and terms change, so confirm them on the vendor's site before you buy.
- Manage Plugins, WordPress documentation — Independent · wordpress.org · read October 14, 2026
- Install a plugin, WordPress.com support — Independent · wordpress.com · read October 14, 2026
- Adding code to headers, WordPress.com support — Independent · wordpress.com · read October 14, 2026
- Theme File Editor screen, WordPress documentation — Independent · wordpress.org · read October 14, 2026
- Child themes, WordPress Theme Handbook — Independent · developer.wordpress.org · read October 14, 2026
- Embedding DocsBot into your WordPress website — Vendor documentation · docsbot.ai · read October 14, 2026
- DocsBot plugin listing on WordPress.org — Vendor product page · wordpress.org · read October 14, 2026
- DocsBot embeddable chat widget — Vendor documentation · docsbot.ai · read October 14, 2026
- DocsBot pricing — Vendor pricing page · docsbot.ai · read October 14, 2026
- WCAG 2.2 Understanding Keyboard (2.1.1) — Independent · w3.org · read October 14, 2026
- WCAG 2.2 Understanding Reflow (1.4.10) — Independent · w3.org · read October 14, 2026
- WCAG 2.2 Understanding Status Messages (4.1.3) — Independent · w3.org · read October 14, 2026
- WCAG 2.2 Understanding Target Size Minimum (2.5.8) — Independent · w3.org · read October 14, 2026