USE CASES AND GUIDES

How to add an AI chatbot to WordPress

You install ChatbotNest on WordPress using a script from your dashboard. This guide covers preparing your knowledge, publishing and testing a conversation on your live site. You need access to WordPress administration and permission to add JavaScript.

1. Prepare your chatbot and test its answers

Create a ChatbotNest account, add an assistant and enter the website it should learn from. Index relevant content such as your services, FAQs and contact information. Adjust the greeting, appearance and instructions, then test questions in your dashboard.

For a WooCommerce store, start with public product descriptions and purchase policies. The script does not automatically connect private orders to your knowledge sources. See our ecommerce chatbot guide for more examples.

2. Verify your domain and publish

Open the installation section in the chatbot editor. Add your domain address including the protocol, for example https://your-domain.com. Use the address visitors actually open. The www and non-www versions are separate installation origins.

Choose one of the ownership checks available in your dashboard:

  • DNS: create a TXT record named _chatbotnest.your-domain.com with the value from your dashboard. DNS providers handle the name field differently; some append the domain automatically.
  • File: make the supplied token available as a text file at https://your-domain.com/.well-known/chatbotnest-verification.txt if you have hosting file access.

Use the DNS or file verification button. Once the check succeeds, publish the chatbot. Do not paste the verification token into a regular WordPress post.

3. Add the script in WordPress

Copy the complete installation code from your dashboard. One option is to add it to the footer using a script tool such as WPCode. With that plugin installed and activated, open Code Snippets → Header & Footer, paste your code in the Footer field and save. Keep any other scripts already in the field.

Your code follows this format. This example is not ready to install: use the actual identifier provided in your dashboard.

<script async src="https://app.chatbotnest.com/widget/v1.js"
  data-chatbot-id="YOUR_DASHBOARD_ID"></script>

If a developer maintains your site, ask them to place your code before the closing </body> tag. Avoid editing a parent theme directly, as an update can overwrite those changes.

See the WPCode global header and footer documentation for its settings. On WordPress.com, JavaScript support depends on your plan and enabled hosting features; check its custom code guidance.

4. Test the widget on your live site

Open the website as a visitor, including in a private browser window and on a phone. Start a conversation, ask about your offer and check the answer sources. If you use a cache or CDN, clear it after saving the script.

If the widget does not appear, check these points:

  • Is your chatbot published, and is the current domain verified?
  • Does the copied identifier belong to the correct chatbot?
  • Is the code saved as a footer script rather than visible text in a page?
  • Is a consent tool, JavaScript optimiser or your site's CSP blocking the widget?

After launch, keep your knowledge up to date and review conversations. For help passing more complex questions to your team, read about customer support chatbots. You can start testing with the Free plan without a payment card.