Add the chat to WordPress

Add one line to your site’s footer with a header and footer plugin, or from a child theme, then check it’s working.

3 MIN READUPDATED 6 SECTIONS

To add an AI chatbot to WordPress, paste Dazza’s one line of code into your site’s footer with a header and footer plugin such as WPCode. If you manage your own theme, a child theme can add it instead. Either way it loads on every page.

Before you start

  • Copy your line. It’s in Settings → Install in Dazza, with your agent’s key already in it:
<script src="https://app.dazza.io/widget.js" data-agent="dz_…" async></script>
  • Publish your agent. The chat button only appears once your agent has a published version.
  • On WordPress.com? Installing plugins needs one of its paid plans.

A header and footer plugin keeps the code safe when your theme updates. These steps use WPCode, which has more than 3 million active installs.

  1. In your WordPress admin, go to Plugins → Add New Plugin.
  2. Search for WPCode, then click Install Now and Activate.
  3. Go to Code Snippets → Header & Footer.
  4. Paste your line into the Footer box. Code there goes just before </body> on every page.
  5. Click Save Changes.
  6. If you use a caching plugin, clear its cache.

Any similar plugin works the same way: put the line in the footer section, not the header.

From a child theme

Block themes, such as Twenty Twenty-Five, have no footer file to edit, so use a plugin. With a classic theme, add the line from a child theme’s functions.php, so theme updates don’t remove it:

add_action( 'wp_footer', function () {
	echo '<script src="https://app.dazza.io/widget.js" data-agent="dz_…" async></script>';
} );

Replace dz_… with your own key. Don’t edit the parent theme’s files: the next update overwrites them.

Check it’s working

  1. Open your site in a new private window, where you’re not logged in, and refresh.
  2. Look for the chat button in the bottom corner, and ask it a question.
  3. In Dazza, Settings → Install shows Installed and the address the chat was last seen on.

Common problems

What you see What to do
No chat button anywhere Publish your agent in Agent. Settings → Install says so if it isn’t live yet.
The chat appears only after a scroll or click A speed plugin is delaying JavaScript. In WP Rocket, LiteSpeed Cache, Autoptimize or similar, exclude app.dazza.io/widget.js from delaying and combining.
No change after saving Clear your caching plugin and any server or CDN cache, then refresh.
No chat on a staging site If you’ve listed Allowed websites in Settings → Install, add the staging address too. Subdomains are included.
The code shows as text on the page It was pasted into a post or a text widget. Use the plugin’s footer box.
Blocked by your security settings If your site sends a Content Security Policy, allow https://app.dazza.io for scripts, connections and frames.
Nothing loads and the code looks odd Some editors turn straight quotes into curly ones. Copy the line again from Settings → Install.

Next

Still stuck? A person reads every message. Contact us ↗