Install the ZapClaw chat widget on WordPress
In short: on a WordPress site you host yourself, paste the widget snippet in the footer. A header and footer plugin is the safest way; your theme's footer is the alternative. For a site on WordPress.com, read the WordPress.com guide instead.
Before you start
- Your agent is published and its widget is active in the dashboard.
- Copy the exact snippet of your widget from the Agents area of the dashboard. The id above is a placeholder: yours is different.
- Allowed websites. In the dashboard, add your site's address to the widget's allowed websites, exactly as visitors see it.
https://www.example.comandhttps://example.comare two different addresses. A site that is not on the list shows no bubble.
<script async src="https://chat.zapclaw.app/loader.js" data-widget-id="YOUR_WIDGET_ID"></script>
Option 1: a header and footer plugin (recommended)
A plugin keeps the snippet when you change or update your theme, and you edit no file.
- In the WordPress admin, open Plugins, then Add New Plugin. Search for a header and footer plugin, for example WPCode, then install and activate it.
- Open the plugin's header and footer settings. In WPCode that is Code Snippets, then Header & Footer. Menu names change between plugins and versions.
- Paste the snippet in the Footer box. The header box works too, because the snippet is
async. - Save, then open your site in a private window and look for the bubble.
Option 2: your theme's footer
Use this only if you cannot install plugins. A change in a theme file is lost when the theme updates, so work in a child theme.
- Open Appearance, then Theme File Editor, and choose the child theme's
footer.php. - Paste the snippet just before
</body>. - Choose Update File, then check the site.
Block themes, the ones edited in the Site Editor, have no footer.php, and some hosts turn the file editor off. In both cases use Option 1.
If the bubble does not appear
- Caches. If a caching plugin or a CDN serves your pages, clear its cache, or visitors keep getting the old page without the snippet.
- Optimization plugins. A plugin that delays, combines or defers scripts may hold the loader back. Exclude
chat.zapclaw.appfrom it. - Content Security Policy. A site with a strict policy must allow
chat.zapclaw.app. The two lines are in the overview.
Visitors and signed-in users
On this platform the widget runs anonymous. It answers from the knowledge bases you marked public, collects a contact and hands the case to a person. What anonymous mode means.
Other install guides
- Overview, with the Content Security Policy lines and the privacy sentence.
- WordPress.com, on the plans that allow plugins.
- Google Tag Manager, with a Custom HTML tag.
Put your agent on your website
Build and publish your agent in the dashboard, then paste the snippet.
About ZapClaw Agents