Multi-platform Integrations

Add Chatbots to WordPress Websites

Add your AI agent to every page of your WordPress site with the free Chat Data plugin. No coding needed.

Before you start

Step 1: allowlist your domain in Settings > Security. Step 2: copy the code from Embed on site. Step 3: paste it on your site, then check the bubble appears

With the plugin you don't copy any code. You paste only your Chatbot ID (step 2).

Step 1: Allowlist your WordPress domain

In Chat Data, open Settings > Security. Set Visibility to public, turn on Embedding On Websites, and add your WordPress domain to Allowed Embedding Domains. To hide the AI agent on certain pages of your site, list them in Disallowed Urls. Full details: Allowlist your domain. Settings > Security with Visibility set to public, Embedding On Websites turned on and your domain in Allowed Embedding Domains

  1. In WordPress, go to Plugins > Add New and search for Chat Data. You can also download it from the WordPress Plugin Directory.
  2. Install and activate the plugin. Chat Data Wordpress plugin
  3. In Chat Data, open your AI agent's Settings > General and copy the Chatbot ID (under Chatbot Info).
  4. In WordPress, go to Settings > Chat Data Options and paste it into Chatbot ID.
  5. Leave Embedding Domain as www.chat-data.com. Change it only if you are on our reseller plan and host the script on your own domain; see White Label Your Chatbot.
  6. Click Save Changes. Wordpress Chat Data plugin setting

The plugin adds the chat bubble to every page of your site.

Alternative: edit your theme's functions.php file

Use this only if you are comfortable editing theme files. It is more direct, but a mistake in functions.php can break your site.

  1. Go to Appearance > Theme Editor, select your current theme and open functions.php. You can also edit the file over FTP in your theme's folder.
  2. Add this code at the end of the file. Replace the <script> line with the Widget Bubble code you copied from Embed on site in Chat Data.
function add_custom_script_to_head() {
echo '<script src="https://www.chat-data.com/embed.min.js?chatbotId=YOUR_CHATBOT_ID" defer></script>' . "\n";
}
add_action('wp_head', 'add_custom_script_to_head');

Insert the embedding script directly

Check that it worked

Open your live WordPress site. The chat bubble should appear. If the chat window shows "Domain: … is not in the allowlisted domains of this chatbot", add that domain in Step 1. More fixes: Check that it worked.

Next step: match the bubble to your brand in Settings > Chat Interface. See Customize the Chatbot Interface.

Frequently Asked Questions

How do I add a Chat Data chatbot to a WordPress website?

The WordPress process starts by allowlisting your production domain in Chat Data and setting the chatbot to `public`, then adding the chatbot to the site either with the official Chat Data plugin or by adding the embedding script to the theme's `functions.php` file.

Why do I need to allowlist my WordPress domain first?

The guide explains that the main WordPress domain must be allowlisted so the chatbot is permitted to appear on the production website. It also notes that you can disallow specific URL paths if there are pages where you do not want the chatbot to show.

Can I install the chatbot on WordPress without the plugin?

Yes. You can also use a manual method where you edit the theme's `functions.php` file and hook a script into `wp_head`. It is a more direct and permanent method, but it requires careful theme-file editing.

Previous
Add Chatbots to Shopify Stores