WordPress how-to

How to Add a Chatbot to a WordPress Website, Step by Step

To add a chatbot to a WordPress website, create an Asyntai account and let it read your pages. Then install the Asyntai plugin from your WordPress admin, or paste your embed code into the footer section of the WPCode plugin. Purge your cache and test the chat in a private window.

Which method suits you depends on your theme and page builder. Use the table below to find yours, then follow only that section. Use one method, not several.

Find your method

Your siteUse this
Any self-hosted WordPress siteMethod 1, the Asyntai plugin, or Method 2, WPCode
Block theme, such as Twenty Twenty-FourMethod 1 or 2. These themes have no footer.php file.
Classic themeMethod 1 or 2, or Method 3 if you prefer to edit theme files
Elementor ProMethod 4, or Method 1 or 2
Elementor Free, Divi, Beaver Builder or another builderMethod 1 or 2. Both add the chat to the whole site from outside the builder.
WooCommerce storeMethod 1 or 2. Read the WooCommerce guide for store options.
WordPress.comA paid WordPress.com plan, then the plugin. See the WordPress.com page.

Not sure which theme type you have? Open the Appearance menu in your WordPress admin. Block themes show Editor. Classic themes show Customize and usually Widgets.

Before you install: give the chatbot your content

  1. Create your account. Sign up on Asyntai and add your website address. The Free plan includes 50 messages a month and up to 50 crawled pages.
  2. Crawl your site. The crawler starts at your homepage, follows your links and checks sitemap.xml. Add files or FAQs for anything that is not on your site.
  3. Try the Test Chat. Find it on the Setup tab of your dashboard. Ask what your customers ask. Test Chat messages do not use your monthly quota, and they stay out of your chat logs.

Method 1: the Asyntai plugin

You do not copy any code with this method, and the plugin stays in place when you change your theme. It needs WordPress 5.0 or higher and PHP 7.4 or higher.

  1. In your WordPress admin, go to Plugins → Add Plugin.
  2. Search for Asyntai. Install the plugin, then activate it. You can also find it on WordPress.org.
  3. Open Asyntai AI Chatbot in the WordPress sidebar.
  4. Click Get started. Sign in to your Asyntai account in the window that opens. You can create an account there too.

When you click that button, the plugin sends your site address to asyntai.com to link the account. If WooCommerce is active, it also creates a read-only WooCommerce REST key and sends it to asyntai.com.

Method 2: WPCode and your embed code

This method works with all theme types. The code stays in place when you update or change your theme.

  1. Open your Asyntai dashboard and copy your code from the Embed Code section. It contains your own widget ID and looks like the example below.
  2. In WordPress, go to Plugins → Add Plugin. Search for WPCode, install it and activate it.
  3. Go to Code Snippets → Header & Footer.
  4. Paste your code into the Footer section.
  5. Click Save Changes.
<script>(function(){var l=function(){var s=document.createElement("script");s.src="https://widget.asyntai.com/static/js/chat-widget.js";s.async=true;s.setAttribute("data-asyntai-id","YOUR_WIDGET_ID");document.head.appendChild(s)};if(document.readyState==="complete"){l()}else{window.addEventListener("load",l)}})();</script>

This is only an example. Copy your own code from the dashboard, because YOUR_WIDGET_ID must be your real ID.

Method 3: classic themes, footer.php

Use a child theme for this method. A theme update overwrites changes in the parent theme, and your chatbot would disappear with them.

  1. Go to Appearance → Theme File Editor. Select your child theme from the dropdown.
  2. Click footer.php in the file list.
  3. Find the closing </body> tag near the bottom of the file.
  4. Paste your embed code just before that tag.
  5. Click Update File.

Developers can use a hook in the child theme's functions.php instead. Paste your full embed code between the single quotes.

function add_asyntai_chatbot() {
  echo 'YOUR_EMBED_CODE';
}
add_action('wp_footer', 'add_asyntai_chatbot');

If the Theme File Editor is not in your menu, your host or a security setting may have turned it off. Use Method 1 or 2.

Method 4: Elementor Pro

  1. Go to Elementor → Custom Code and click Add New.
  2. Give it a name, such as Asyntai Chatbot.
  3. Set the location to <body> - End and paste your embed code.
  4. Set the display conditions to Entire Site.
  5. Click Publish.

Custom Code is an Elementor Pro feature. On Elementor Free, use Method 1 or 2.

Purge your cache

A caching plugin can keep serving the old page without the chat. Purge every layer that your site uses, in this order: plugin, host, then CDN.

LayerWhat to do
WP RocketClear the cache. If the chat appears only after you move the mouse or scroll, Delay JavaScript Execution is holding it back. On the File Optimization tab, add asyntai to the excluded scripts.
W3 Total Cache, WP Super Cache, LiteSpeed CacheUse the purge or delete cache option in the plugin. If you turned on delayed or combined scripts, exclude scripts that contain asyntai.
Managed WordPress hostUse the purge button in your hosting panel or WordPress admin bar.
Cloudflare or another CDNPurge the cache. If the chat still does not load, turn off Rocket Loader for a test.

Test it on the live site

Test Chat shows the answers. These checks show that the installation works for real visitors.

  1. Open a private window. Go to your homepage. The chat button appears in the bottom right corner by default.
  2. Ask a real question. Choose something that only your site can answer, such as your delivery area or your opening hours. This message counts toward your monthly quota.
  3. Check your chat logs. Open the Chat Logs in your dashboard and find the conversation. If it is there, the widget is connected to your account.
  4. Check other page types. Open a post, a landing page built in your page builder and, on a store, a product page and the cart.
  5. Check a real phone. Open and close the chat. Make sure that a sticky menu or cookie banner does not cover the button.

If the chat does not appear

What you seeLikely causeFix
No chat in any browserCached pagePurge all layers, then reload in a new private window.
No chat, and data-asyntai-id is not in the page sourceThe snippet did not save or the plugin is not linkedSave the code in the Footer section again, or click Get started in the plugin.
Console says "Asyntai Widget" and a missing IDThe code was changed when you pasted itCopy it again from the dashboard. Paste it into a code field, not a text block.
Chat is missing only in your own browserAd blocker or privacy extensionTest in a clean browser profile.
Script is blocked in the consoleA security plugin sets a strict content security policyAllow asyntai.com and widget.asyntai.com in that policy.
Chat is missing on one pageThe page is in your exclude list, or it uses a separate templateCheck Exclude Pages. If you used footer.php, check that the template loads that file.

Make it your own: custom settings for a WordPress chatbot

After the install, you change almost everything in the Asyntai dashboard. You do not have to edit WordPress again.

  • Look: set colours, position and welcome text in Customization.
  • Answers: write instructions for tone and topics, and add exact FAQ answers in the knowledge base.
  • Where it shows: hide the chat on pages such as checkout with Exclude Pages. It is on all plans and matches exact URLs.
  • How it opens: add your own "Chat with us" link with a custom open button, also on all plans.
  • Store data: from the Standard plan, the WooCommerce integration syncs your product catalogue.
  • New content: run the crawl again when you publish pages that the chatbot should know.

Still choosing a tool? Read our comparison of the best chatbots for WordPress. For staff replies in the chat, follow how to add live chat to WordPress.

Frequently asked questions

Do I need a plugin to add a chatbot to WordPress?

No. On a classic theme, you can paste the embed code into footer.php. On a block theme, use the Asyntai plugin or WPCode, because there is no footer.php file.

Will I lose the chatbot when I update my theme?

Not with the plugin or WPCode. With footer.php, a theme update overwrites your edit unless you work in a child theme.

Can I add the chatbot to some pages only?

Yes. List the pages to hide in Exclude Pages. On a store, the WooCommerce guide also has a hook that loads the chat on shop, product, cart, checkout and account pages only.

Can I use it on more than one WordPress site?

Yes. Your plan sets the number of websites: 1 on Free, 2 on Starter, 3 on Standard and 20 on Pro. Compare them on the pricing page.

Get your WordPress embed code

Create your account, let Asyntai read your site, and try the answers in the Test Chat before you install anything. The Free plan includes 50 messages a month.

Start free

Explore Our Solutions

Find the right AI chatbot for your platform and use case.

Blog in other languages: Deutsch Français Português