How to add an AI chatbot to your WordPress site
What you'll need
You need an AskVault account (free, 100 queries per month included) and admin access to your WordPress site. The widget works with every WordPress version from 5.0 onward and every theme we've tested, including the major page builders: Elementor, Divi, Beaver Builder, Oxygen, and the default Twenty-* themes. WooCommerce stores are supported. WordPress.com (the hosted service) requires a Business plan or higher because Free and Personal plans block custom JavaScript.
If your site runs WooCommerce, the AskVault widget can also pull order data via the WooCommerce integration, which lets the agent answer "where is my order?" automatically. That's a separate setup, not required for basic chat.
Method 1: paste the script tag into your theme's footer.php
This is the fastest method if you're comfortable editing PHP files directly. Five steps:
-
Sign in to AskVault, open Deploy > Widget, copy the workspace token from the generated snippet.
-
In your WordPress admin, go to Appearance > Theme File Editor.
-
Pick footer.php from the file list on the right.
-
Find the closing
</body>tag (use Ctrl+F to search). Paste this snippet on the line right before it:<scriptasyncdefersrc="https://api.askvault.co/widget.js"data-workspace-token="wt_yourtoken_here"></script> -
Click Update File. Visit your site in a new incognito tab. The launcher appears bottom-right within about 200 ms.
Warning about child themes. If you're using a parent theme without a child theme, your edit will be wiped the next time the theme updates. Create a child theme first, or use Method 2 or Method 3 below.
Method 2: use the free Code Snippets plugin (recommended for most users)
If you don't want to touch theme files, install the Code Snippets plugin (10 million+ active installs, free). It survives theme updates and lets you add JavaScript site-wide from the WordPress admin.
- Go to Plugins > Add New, search for "Code Snippets", install and activate it.
- Click Snippets > Add New in the left sidebar.
- Title it "AskVault chat widget".
- Pick the HTML / JS snippet type from the dropdown at the top.
- Set Insert to Site Footer.
- Paste the AskVault script tag (same one as Method 1).
- Click Save Changes and Activate.
This method is bulletproof. The snippet runs site-wide, is exempt from theme updates, and toggles on or off with a single click. We recommend it for any WordPress install that doesn't already have a JavaScript-management plugin.
Method 3: install via Google Tag Manager
If your site already uses GTM for analytics, add the widget there. It keeps all JavaScript additions in one place and lets you A/B test or schedule the widget without redeploying.
- Sign in to Google Tag Manager, open your container, click Tags > New.
- Click Tag Configuration > Custom HTML.
- Paste the AskVault script tag.
- Set the trigger to All Pages (or limit it to specific pages with a path-based trigger if you only want the widget on certain routes).
- Save the tag, then Submit the GTM container to publish.
The widget appears within a few minutes once GTM finishes propagating the new container version.
Add the WhatsApp channel too (optional)
WordPress visitors who don't want to use a website chat widget often prefer WhatsApp. AskVault deploys to both with the same knowledge base. After the widget is live:
- Open Deploy > WhatsApp in the dashboard.
- Connect your WhatsApp Business number (Meta Cloud API or Twilio).
- Visitors can now chat with the same AI agent via the website widget or your WhatsApp number. Same answers, same source citations, one inbox in the dashboard.
This is on the Growth plan and above. Growth+
WooCommerce: let the bot answer order-status questions
If you sell with WooCommerce, the agent can answer "where is my order?" without you writing any logic. Set up the WooCommerce integration and enable the wc_order_status skill. Visitors enter their order ID or email; the bot looks it up via the WooCommerce REST API and responds with the live status, tracking link, and estimated delivery date.
The integration is read-only by default. It can look up orders but never modify them. You enable the integration via OAuth from the WooCommerce side and it appears under AI Agents > Skills in the AskVault dashboard.
Performance and SEO impact
The widget loads with async + defer, so it never blocks WordPress page rendering. The bundle is 12 KB gzipped. Lighthouse Performance impact: zero. Largest Contentful Paint, First Input Delay, and Cumulative Layout Shift all stay clean.
The widget does NOT inject any HTML into your page content until the launcher is clicked. That means it doesn't interfere with WordPress SEO plugins (Yoast, Rank Math, AIOSEO), doesn't affect schema markup, and doesn't change how Google renders your page.
Troubleshooting
The launcher doesn't appear after I save. Open your site in an incognito or private window. Some WordPress caching plugins (WP Rocket, W3 Total Cache, LiteSpeed Cache) serve a stale page version to logged-in admins. Clear the cache from Settings > [your cache plugin] or wait 10 minutes.
My theme has no footer.php.
Block themes (Twenty Twenty-Two and later) use Full Site Editing instead of PHP templates. Use Method 2 (Code Snippets plugin) or Method 3 (Google Tag Manager) instead.
The launcher appears on every page, including checkout.
That's the default. To hide the widget on specific pages, use Method 3 (GTM) and add a page-path trigger that excludes /cart/, /checkout/, and any other route where the widget shouldn't appear.
JavaScript console error "AskVault is not defined". Another script tag is loading something different at the same global. Check your Appearance > Custom JS or any old chat plugin you forgot to uninstall.
FAQ
Does AskVault have a dedicated WordPress plugin?
Not yet. We ship the widget as a vanilla script tag because it works on every WordPress version, every theme, and every page builder. A native plugin would add maintenance overhead without making setup faster than Method 2.
Will the widget slow down my WordPress site?
No. The widget is 12 KB gzipped and loads asynchronously with defer. PageSpeed Insights scores stay identical with or without the widget installed.
Can I show the widget to logged-in users only?
Yes. With Code Snippets, wrap the script tag in a PHP conditional:
<?php if ( is_user_logged_in() ) : ?> <script async defer src="https://api.askvault.co/widget.js" data-workspace-token="wt_..."></script><?php endif; ?>Set the snippet type to PHP and insert location to Site Footer.
Does it work with Multisite?
Yes. Install the Code Snippets plugin network-wide, or paste the script tag into the shared footer template. Each WordPress site can use its own AskVault workspace, so each site can have a different knowledge base.
Does the widget collect cookies?
No first-party cookies by default. The widget uses localStorage to persist a conversation ID across page loads for return visitors. If you need a strictly cookie-free experience for GDPR compliance, contact support@askvault.co for the local-storage-disabled config.
Related guides
- Install the AskVault widget on any website
- How to embed an AI chatbot on a React website
- How to embed an AI chatbot on Shopify
- WooCommerce integration setup
- Widget customization in Widget Studio
- Custom domain setup