How to add an AI chatbot to WordPress (no plugin needed)
Before you start
You need an AskVault account with your site crawled, and admin access to WordPress. The Free plan covers 50 messages a month and 5 MB of content. If you have not crawled your site yet, follow get started first; the widget can only answer from content AskVault has indexed.
The widget works with any modern WordPress theme and page builder. On WordPress.com, custom scripts need a plan that allows plugins.
AskVault WordPress plugin Rolling out. A one-field plugin, where you paste your widget token and save, is on its way to the WordPress.org directory. Until it is listed there, use one of the three methods below.
Method 1: a code snippets plugin (easiest)
A snippets plugin adds the script site-wide from the WordPress admin, and the snippet survives theme updates.
-
In AskVault, open Channels > Web widget and copy your script tag.
-
In WordPress, go to Plugins > Add New, install a code snippets plugin such as Code Snippets or WPCode, and activate it.
-
Add a new HTML snippet called "AskVault chat widget".
-
Set it to load in the site footer.
-
Paste the script tag and save it as active:
<scriptasyncdefersrc="https://api.askvault.co/widget.js"data-token="wt_yourtoken_here"></script> -
Open your site in a private window. The chat launcher appears in the bottom-right corner.
Method 2: your child theme's footer.php
Use this if you already maintain a child theme. Editing a parent theme directly is risky, because the next theme update erases your change.
- Go to Appearance > Theme File Editor and select your child theme.
- Open footer.php and find the closing
</body>tag. - Paste the script tag on the line above it and click Update File.
Block themes, such as Twenty Twenty-Two and later, have no footer.php. Use Method 1 or Method 3 instead.
Method 3: Google Tag Manager
If your site already loads Google Tag Manager, keep the widget there with your other scripts.
- In Tag Manager, create a new tag of type Custom HTML.
- Paste the AskVault script tag.
- Set the trigger to All Pages, or to a page-path trigger if you want the widget only on some pages.
- Save and Submit the container to publish it.
Tag Manager is also the simplest way to hide the widget on /cart/ or /checkout/: add those paths as exceptions on the trigger.
WooCommerce: answer "where is my order?"
Growth+Connect your store through the WooCommerce integration and enable the WooCommerce Order Status skill under Automation > Skills. When a shopper asks about an order, the agent asks for the order number or email, looks the order up in WooCommerce and replies with its status. The skill only reads orders.
Coming next Rolling out: same-country address changes and cancel-with-refund, always after the shopper confirms a card, plus a "Get help with this order" button on order pages so shoppers never have to type their order number.
Answer on WhatsApp as well
Some visitors would rather message you than use a website chat. On Growth and up, connect your WhatsApp Business number under Channels > WhatsApp and the same agent answers there, with the same knowledge and one shared inbox. See WhatsApp setup.
Speed and SEO
The script loads with async and defer, so it never holds up your page. The widget bundle is about 73 KB compressed, and the launcher is fixed-positioned, so it does not shift your layout. The chat panel is rendered by the widget, not added to your page's HTML, so SEO plugins such as Yoast, Rank Math and AIOSEO keep working as before.
Troubleshooting
The launcher does not appear. Caching plugins like WP Rocket, W3 Total Cache and LiteSpeed Cache can serve signed-in admins an old page. Clear the cache or check in a private window.
My theme has no footer.php. It is a block theme. Use the snippets plugin or Tag Manager.
"AskVault is not defined" in the browser console. An old chat plugin or a second copy of the script may be loading. Remove the duplicate.
FAQ
Is there an AskVault WordPress plugin?
One is built and rolling out to the WordPress.org directory. For now, use the script tag.
Can I show the widget only to logged-in users?
Yes. In a PHP snippet, wrap the tag in a check:
<?php if ( is_user_logged_in() ) : ?> <script async defer src="https://api.askvault.co/widget.js" data-token="wt_..."></script><?php endif; ?>Does it work on WordPress Multisite?
Yes. Each site can load its own AskVault workspace token, so each site gets its own knowledge base.
Does the widget store anything in the visitor's browser?
It keeps a conversation ID in the browser's local storage so a returning visitor can pick up where they left off.
Related guides
- Add the widget to any website
- Add a chatbot to Shopify
- WooCommerce integration setup
- Customize the widget