# How to add an AI chatbot to a WordPress site

**Paste the script tag into your site's footer. The easiest way is a "header and footer code" plugin such as WPCode, so you don't have to touch theme files.** Get a key at [/get-api-key](/get-api-key) first.

1. In WordPress admin, install and activate a header/footer code plugin.
2. Open its **Footer** box and paste:

```html
<script src="https://onelinechat.com/widget.js" data-key="olc_pub_YOUR_KEY" async></script>
```

3. Save, then reload your site. The chat bubble appears in the bottom-right corner.

## Notes

- Comfortable editing themes? In a classic theme, put the line before `</body>` in the child theme's `footer.php`. Block themes don't have that file, so use the plugin instead.
- Using a page-cache plugin? Purge it once after saving, or logged-out visitors keep getting the old page.

---
Source: https://onelinechat.com/install/wordpress · Last updated: 2026-11-20 · All docs: https://onelinechat.com/llms.txt
