Hazelchat for WordPress
What you need
- A self-hosted WordPress site, version 6.3 or later with PHP 7.4 or later. On WordPress.com you need a plan that allows plugins.
- Permission to install plugins and change settings on the site.
- A Hazelchat account. The Free plan includes 50 answers a month on one website, with no card.
Add Hazelchat to your WordPress site
- In WordPress, go to Plugins → Add New Plugin, search for Hazelchat, then install and activate it. Activating it alone loads nothing on your site.
- In Hazelchat, add your content, check the details and try your agent. Under Website → Installation, add your website's domain.
- Copy the 64-character
data-agentvalue from Hazelchat's installation code. This is your public widget key, not a password. - In WordPress, open Settings → Hazelchat. Paste the key, accept the hosted-service connection, turn on Load Hazelchat on public pages and save.
- If you pasted a Hazelchat script into your theme before, remove it. Then clear your page cache.
- Back in Hazelchat, click Publish and switch on (or Switch on Hazelchat if your published agent is unchanged). Hazelchat checks that the script is on your website before the agent goes live. Refresh your website and complete Test on your website.
What the plugin does
The plugin adds one script, https://app.hazelchat.co/widget.js, with your public key to the footer of your public pages. It stores only that key and three on/off settings. It does not read your posts, users, orders or carts, and it sends nothing from WordPress to Hazelchat. Your content, answers, enquiries and billing all stay in your Hazelchat workspace.
The WordPress admin, feeds and draft previews never load the chat.
Visitor consent
If your site asks visitors for consent first, tick Wait for my consent manager before opening a connection to the chat service in Settings → Hazelchat. The chat then stays closed and sends no chat requests until your consent tool tells it to start:
window.dispatchEvent(new CustomEvent('hazelchat-consent', { detail: true }));
Send detail: false when a visitor withdraws consent. The plugin does not configure consent tools for you. If your site must block even the script download, let your consent tool block that script too.
Caching and optimisation plugins
- Clear your page cache after you install, change the key or remove the plugin.
- Exclude
https://app.hazelchat.co/widget.jsfrom script combining, rewriting or delayed loading. The script must keep its own address and key. - Your theme must call
wp_footer(), which almost every theme does. - If your site sends a Content-Security-Policy, allow
https://app.hazelchat.coinscript-srcandframe-src.
Change or remove
- New widget key: if you rotate the key in Hazelchat, paste the new one in Settings → Hazelchat and clear your cache.
- Pause the chat: switch Hazelchat off in your workspace. It stops answering straight away, even on cached pages.
- Remove it from the site: turn off loading, or deactivate the plugin. Deactivating keeps your settings; deleting the plugin removes them. Your Hazelchat account and plan are not affected.
Help
Email hello@hazelchat.co. We answer within one business day. Not on WordPress? See all the ways to install Hazelchat.