HomeAdd a widgetWordPress

AI chat · WordPress

Add an AI chat widget to WordPress

A chat agent that answers from your own content, floating in the corner of every page on WordPress — with 200 conversations a month included on the $19 plan, and a person able to take over at any point.

Free plan, no card. Paid plans start at $19 a month.

Why do it this way on WordPress

Put this one site-wide, not in a block. A Custom HTML block only exists on the page you added it to, so a launcher pasted there floats over that one page and vanishes everywhere else — which is not what a support widget is for. A footer snippet plugin like WPCode (or an mu-plugin, if you would rather not add a plugin a client can deactivate) puts the script before </body> on every page and survives your next theme update.

See it working

There is a live one on this page already. The chat button in the bottom corner is a Sorraia AI chat agent — ours, answering from this site’s own content — installed exactly the way the steps above describe. Open it and ask it something.

How to add an AI chat widget to WordPress

A launcher that has to appear on every page needs a site-wide script, not a block on one page.

wordpress.org and WordPress.com are not the same gate

Self-hosted WordPress has no plan gating on any of this. WordPress.com does: on the free plan the Custom HTML block strips script, style, link, iframe, frame, form, input, object, textarea and embed tags, so nothing renders — and note that link is on that list, meaning an externally-linked stylesheet is blocked too, not just inline CSS. Its paid plans — Personal, Premium, Business and Commerce — all allow custom code, but you have to install at least one plugin before the plan’s hosting features switch on, so a paid site that has never installed a plugin will still have the embed silently removed.

  1. In Sorraia, add the website and verify it — a DNS TXT record, or a meta tag in your homepage’s <head>. Verification is what lets you attach a widget to that site, so it comes before there is anything to paste.

  2. Save the agent, then copy the snippet from the Embed code box in the right-hand panel of the chat builder. (Chat has no install wizard — the box is the whole thing.)

  3. Install a snippet plugin: Plugins → Add Plugin → search “WPCode” → Install Now → Activate.

  4. Go to Code Snippets → Header & Footer.

  5. Paste the Sorraia snippet into the Footer box and click Save Changes. It now loads on every page.

  6. Open the live site (logged out, or in a private window) and confirm the launcher appears in the corner.

Editing the theme directly

You can paste the snippet before </body> in footer.php via the Theme File Editor — Appearance → Theme File Editor on a classic theme, Tools → Theme File Editor on a block theme. Two catches: a theme update erases it unless you are on a child theme, and managed hosts (WP Engine, Kinsta, Flywheel) disable the editor by default. Appearance → Customize is not a route at all: WordPress core gives it an Additional CSS field and no JavaScript field. Any header/footer script box you see there was added by a commercial theme, not by WordPress.

What you get

A chat agent that answers from your own content, floating in the corner of every page on WordPress — with 200 conversations a month included on the $19 plan, and a person able to take over at any point.

200 conversations a month on the $19 plan

The monthly allowance is 25 conversations on Free, 200 on Starter at $19/month, 1,000 on Growth, 5,000 on Business and 20,000 on Enterprise. A conversation counts once when it starts, not per message, and the counter resets at the start of each UTC month.

Past the cap it keeps answering, at a price you can see

On any paid plan the agent carries on past its allowance at $15 per 100 additional conversations — or part of 100, so one conversation over the line is one $15 pack, and we would rather say that than let you discover it on an invoice. Every account also carries a ceiling on how many packs it will buy, defaulting to ten ($150 of extra exposure), and at the ceiling the widget behaves exactly as it does with overage switched off. Free does not run an overage; it stops at 25.

It says it is an AI, always

Every conversation opens with a line naming the agent as your business’s AI assistant and noting that a human can take over. That line is not a setting — the widget will not render without it. When someone from your team does take over, the status changes to say so.

It answers from your site, not from the open internet

The agent is grounded in your own content, which is why it can answer a question about your pricing or your opening hours and will not invent a policy you never wrote. If a calendar is wired up it can also take a booking mid-conversation — and it only claims it can book when one actually is.

More detail in the Help Center: The AI chat agent · Embedding on your website

Things worth knowing about WordPress

  • Silent script stripping is the most common failure. WordPress removes <script> on save from any user without the unfiltered_html capability — always the case for non-Super-Admins on multisite, and often on a single site where a security plugin (Wordfence, Solid Security) or DISALLOW_UNFILTERED_HTML has taken it away. The block saves cleanly and the script is simply gone.
  • Caching and optimisation plugins are the second. WP Rocket, Autoptimize, LiteSpeed Cache and Perfmatters defer, combine, minify or lazy-load JavaScript by default, which breaks async widget loaders. Add the Sorraia script URL to the plugin’s exclusion list.
  • The block editor’s preview pane is a sandboxed iframe, so a floating launcher looks clipped inside the block while you edit and works correctly for visitors. Check the published page, not the editor.

Questions

What happens when I hit the monthly conversation limit?

On a paid plan, nothing visible: the agent keeps answering and the extra conversations bill at $15 per 100 — rounded up to the next pack — capped by a per-account pack ceiling you control, ten by default. On Free it stops starting new conversations for the rest of the month, and the widget degrades rather than vanishing: the panel still opens, the disclosure line corrects itself to say the assistant is offline, the message box is disabled, and your WhatsApp and email handoffs are surfaced instead. A conversation already in progress is never cut off. The visitor is never shown your plan, your usage, or the reason.

Will visitors know they are talking to an AI?

Yes, by design. The disclosure line is always rendered — it names your business, says “AI assistant”, and tells the visitor a human can step in — and it cannot be switched off in the builder. If a teammate takes the conversation over, the widget stops describing itself as the AI and says the team is live.

Can a person take over a conversation?

Yes, and the visitor is told both times. Pick up any live conversation from the Conversations page and the widget posts “A team member has joined the conversation.” and switches its status from “AI assistant · replies instantly” to “Live · with the team”. Hand it back and it says so. If whoever took over walks away, the conversation returns to the AI on its own after about ten idle minutes rather than leaving the visitor waiting on someone who has gone.

Do I need a plugin to add a Sorraia widget to WordPress?

No. An inline widget goes in a Custom HTML block, which is part of WordPress itself. A plugin is only worth installing for the site-wide case — a floating chat launcher on every page — because a footer snippet plugin like WPCode survives theme updates, while a hand-edited footer.php does not.

The widget disappeared after I saved the page. Why?

Almost always script stripping. WordPress removes script tags on save from users without the unfiltered_html capability, and security plugins remove that capability from ordinary administrators. To confirm: open DevTools → Network, save the block, and inspect the request — if the script is in the request body but missing from the response, something stripped it server-side. Adding it site-wide through a snippet plugin sidesteps the block’s filtering entirely.

Add an AI chat widget to WordPress

Build it in Sorraia, paste one line into your WordPress site, and change it later without touching the embed again.