WordPress

An AI chat widget for WordPress, installed without touching your theme

An AI chat widget for WordPress is a chat window that answers visitors from the facts you give it, using your own AI provider key. WordPress has no single built-in place to add a script to every page, so this page shows the three usual ways, the caching mistakes that hide the widget, and what to paste so the agent sounds like your site.

1 script tagin a footer plugin, a child theme or code
Cache purgethe most common reason a new install seems missing
100 freeconversations a month, no credit card

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.

Put an AI chat on your WordPress siteStart free, paste one script into a footer plugin and test on your live pages. No credit card.
Start free

The install in five steps

This is the summary. The WordPress install guide has the full screens, code and the logged-in-user example.

  1. 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.

  2. 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.

  3. Paste the snippet before the closing body tag

    In a plugin, that is its Footer box. Save.

  4. Purge every cache

    Clear your page-cache plugin, host cache and any CDN so visitors get the new page.

  5. 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

WordPress install methods
MethodGood forWatch 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.phpClassic 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 pluginDevelopers 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.

Caching and optimization problems on WordPress
What you seeCauseFix
Snippet saved but launcher missingA 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 lateA “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 optimizingCombine or minify JavaScript swallowed the script.Exclude the CDN host from combining and minifying.
Fixed in one browser, old in anotherCloudflare 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_allowed or a CORS error. The origin must match exactly: www or 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.

Frequently asked questions

Do I need a plugin to add the chat widget to WordPress?

Not a dedicated one. The widget is one script tag. A header and footer scripts plugin is the easiest way to paste it, but you can also edit a child theme or enqueue it in code.

Why is the widget not showing after I added the snippet?

Usually a cache. Purge your page-cache plugin, host cache and any CDN, then hard-refresh in a private window while logged out. If it is still missing, check that widget.js loads in the Network tab and that your origin is allowed.

Will a performance plugin slow or break the widget?

Delay-JavaScript options can make the launcher appear late, and combine or minify options can break it. Exclude the SiteTrellis script from both.

Does it work with WooCommerce?

The widget runs on WooCommerce pages like any other, but there is no native WooCommerce connector. For order status, build a custom HTTP tool that calls an endpoint you control and checks the visitor server-side.

Can the agent read my posts and pages automatically?

No. There is no website crawler or document upload. You paste the text you want the agent to use.

Does it work on a WordPress staging site?

Only if the staging origin is in the allowed origins list. A staging domain is a different origin, so otherwise the widget is blocked there.

Put an AI chat on your WordPress site

Start free, paste one script into a footer plugin and test on your live pages. No credit card.

  • No credit card
  • Live in about 5 minutes
  • Your keys, your rules
Start free, no credit card