What an AI chat widget does for a WordPress site
WordPress sites tend to be content-heavy: dozens of posts, service pages, a membership area or a WooCommerce shop. Visitors skim, fail to find an answer and leave. A chat widget gives them somewhere to ask instead.
- Content and service sites: answer pricing, availability and “do you cover my area?” from text you paste, and capture a lead when the visitor wants a quote. See chatbots for lead generation.
- Membership and course sites: explain tiers, refund terms and where to find things, then hand off to a person for account problems.
- WooCommerce shops: answer shipping and returns questions. There is no native WooCommerce connector, so order status needs a custom HTTP tool pointing at an endpoint you control.
The agent runs on your own key from Anthropic, OpenAI, Gemini, DeepSeek or OpenRouter, so the AI is billed by the provider, not by SiteTrellis. The BYOK overview explains the model, and chatbots for customer support covers the support side.
The install in five steps
This is the summary. The WordPress install guide has the full screens, code and the logged-in-user example.
Prepare the site and agent
Create a site in the dashboard, publish an agent and copy the snippet. Add your site’s exact origin, such as
https://www.example.com, to Allowed origins. The quickstart covers this.Pick an install method
A header and footer scripts plugin is the easiest and survives theme changes. A child theme or small plugin works if you maintain code.
Paste the snippet before the closing body tag
In a plugin, that is its Footer box. Save.
Purge every cache
Clear your page-cache plugin, host cache and any CDN so visitors get the new page.
Check as a visitor
Open a public page in a private window while logged out of WordPress, hard-refresh and look for the launcher.
Three ways to add the script, compared
| Method | Good for | Watch out for |
|---|---|---|
| Footer scripts plugin (for example WPCode or Insert Headers and Footers) | Most site owners. Survives theme updates and changes. | One more plugin to keep updated. |
| Theme footer.php | Classic themes you control. | Theme updates overwrite it unless you use a child theme; a typo in PHP can break the site, so back up first. Block themes have no footer.php. |
| Enqueue from a child theme or custom plugin | Developers who want the script managed in code. | WordPress adds no custom data attributes by default, so a filter must add the site id; the async strategy needs WordPress 6.3 or later. |
Page builders such as Elementor or Divi have their own custom-code areas, but the footer plugin applies to the whole site and is simpler.
Caching and optimization plugins: why the widget “disappears”
Most WordPress install problems are not about the widget at all. They are about a plugin that stores or rewrites your pages.
| What you see | Cause | Fix |
|---|---|---|
| Snippet saved but launcher missing | A page cache (WP Super Cache, W3 Total Cache, LiteSpeed Cache or a host cache) serves the old copy. | Purge the cache, then hard-refresh. |
| Launcher appears late | A “delay JavaScript” option postpones third-party scripts until the first interaction. | Add the SiteTrellis script URL to the exclusion list. |
| Widget broken or missing after optimizing | Combine or minify JavaScript swallowed the script. | Exclude the CDN host from combining and minifying. |
| Fixed in one browser, old in another | Cloudflare or another CDN caches the HTML. | Purge the CDN as well. |
The widget’s own settings are cached briefly, so colour or text changes can take about a minute to show. Hard-refresh before you assume something is wrong.
Other WordPress problems, and how to find them
- Origin blocked: the console shows
origin_not_allowedor a CORS error. The origin must match exactly:wwwor not,https, no trailing slash. A staging domain is a separate origin, which is a handy way to keep test chats out of production. - Not visible only to you: check you are testing logged out, and that page rules or “hide on mobile” in the widget settings are not excluding the page.
- Nothing at all: view the page source and search for
widget.js. If it is absent the snippet was not saved or a cache is serving an older page. - Multisite: create one SiteTrellis site per WordPress site, or share one id and list every origin.
- Restricted hosting: if your plan does not let you install plugins or edit code, you cannot add the script yourself; ask your host.
The browser’s Network tab shows whether widget.js returned 200. More in troubleshooting.
What to paste as knowledge for a WordPress site
SiteTrellis does not crawl your site or read uploaded documents. Knowledge is text you paste, so copy the content that answers real questions out of your pages.
- Your service or product pages, trimmed to facts: what you offer, areas covered, prices or “from” prices, turnaround.
- Policies from the footer pages: shipping, returns, privacy, membership cancellation.
- For courses and memberships: tier differences, what is included, how access works, and where to log in.
- The FAQ block you already wrote, as question-and-answer pairs.
- A “do not promise” list: no discounts, no delivery dates you cannot confirm, no legal or medical advice.
Turn on strict knowledge mode so the agent says “I don’t know” and hands off instead of improvising. Because pasted text does not update when you edit a post, add a reminder to refresh it. See Build your agent.
Honest limits on WordPress
There is no dedicated SiteTrellis plugin to install and no automatic sync of posts. Replies arrive whole rather than streaming, and there are no voice or WhatsApp channels. You also need a funded AI provider key.
If you tell the agent who a logged-in member is, only do so when your privacy policy covers sending their name and email to your AI provider, and remember those browser values are not verified. Back to the integrations overview, or compare with other install routes.