Add Olotalk to WordPress
WordPress has no single “custom code” box, so the reliable paths are a footer hook or a headers-and-footers plugin.
You’ll need your Assistant ID (ast_oltk_…) from your assistant’s Install step. New here? Start with the Quick start.
Easiest: the official Olotalk plugin
- In wp-admin, open Plugins → Add New and search for Olotalk.
- Install and activate Olotalk Grounded AI Assistant.
- Open Settings → Olotalk and click Connect to Olotalk.
- Sign in, confirm the site, and choose an assistant. The Assistant ID fills itself in.
No theme files, nothing to copy, and no ID to find. The plugin stores your Assistant ID and its display name, and removes both when you delete the plugin.
What connecting shares
Before handing anything over, Olotalk shows you which site is asking and exactly what it will receive: the assistant’s ID and display name, and nothing else. No account access, no API key, and none of your content.
If that site’s domain is not already on your Olotalk account, you will see a warning naming it and have to confirm you recognise it before continuing. Either way, Olotalk emails you once a connection completes, so one you did not start cannot pass unnoticed.
If connecting does not work
| What you see | What happened | What to do |
|---|---|---|
| This connection link is incomplete or malformed | The link reached Olotalk without everything it needs, usually because it was opened from history or an email rather than pressed in wp-admin. | Start again from Settings → Olotalk. |
| Connection code expired or already used | A connection is valid for a few minutes and can be used once. | Press Connect to Olotalk again. |
| Confirm you recognise the site before connecting | The domain is not on your Olotalk account. | Tick the confirmation if the site is yours. If it is not, close the page. Nothing has been shared. |
| This site’s address and its admin address are on different domains | WordPress Address and Site Address point at different hosts, which a connection cannot span. | Paste the Assistant ID by hand instead. |
| The button does nothing, or the return trip never arrives | A security plugin, SSO layer, or managed host blocked the redirect. | Paste the Assistant ID by hand instead. |
You need the Administrator role to connect or to change these settings; the button is not shown to anyone else.
The Assistant ID field never goes away. Both paths end in the same place, and pasting the ID is always the reliable fallback. You can also hide the button entirely from Settings → Olotalk if you would rather your team only ever pasted an ID.
Would rather not install a plugin, or already run a headers & footers plugin? The manual paths below work just as well.
Alternative: a headers & footers plugin
If you’d rather not touch theme files, install a plugin that injects raw HTML, WPCode and Insert Headers and Footers are the common ones.
- Install and activate the plugin.
- Open its settings (e.g. Code Snippets → Header & Footer, or Settings → Insert Headers and Footers).
- Paste the snippet into the Footer / Body box and save:
<script
src="https://cdn.jsdelivr.net/npm/@olotalk/assistant-loader@0/dist/loader.iife.js"
data-olotalk-assistant-id="YOUR_ASSISTANT_ID"
async
></script>
These plugins output the snippet verbatim, so the data-olotalk-* attributes survive.
Theme code: the wp_footer hook
If you maintain your own (child) theme or a site-specific plugin, add the loader on wp_footer:
// functions.php (child theme or site-specific plugin)
add_action( 'wp_footer', function () {
?>
<script
src="https://cdn.jsdelivr.net/npm/@olotalk/assistant-loader@0/dist/loader.iife.js"
data-olotalk-assistant-id="YOUR_ASSISTANT_ID"
async
></script>
<?php
} );
Don’t use plain wp_enqueue_script() for the loader. The assistant needs the data-olotalk-* attributes on the generated <script> tag; if you enqueue manually, add them with the script_loader_tag filter. Otherwise use the raw wp_footer snippet above or a headers-and-footers plugin.
Allow your domain
Add your site’s domain under your assistant’s Install domains, or the assistant stays hidden. If you publish from a *.wordpress.com or *.wpcomstaging.com preview URL, add that too.
If a caching plugin (WP Rocket, W3 Total Cache, LiteSpeed) has a “delay JavaScript execution” option, exclude olotalk from it, otherwise the launcher won’t load until the visitor interacts with the page.
Verify
Open your published site and look for the chat launcher in the bottom-right. Then check your dashboard: the Install step’s Install status card shows Seen on yourdomain.com once the snippet loads, with a one-click fix if the domain isn’t allowed yet. Nothing there? See Troubleshooting.