footer.php directly, but note that changes will be lost when the theme is updated.
- Plugin (recommended)
1
Install a header/footer scripts plugin
Go to Plugins → Add New in your WordPress admin. Search for and install one of:
- Insert Headers and Footers (WPBeginner)
- Head, Footer and Post Injections
- Scripts n Styles
2
Paste the snippet into the footer section
Open the plugin’s settings page (the exact path varies by plugin, e.g. Settings → Insert Headers and Footers). Find the Footer or Scripts in Footer field and paste:Replace
kb_xxx and bq_pk_... with your actual values. Save the settings.3
Verify on the front end
Visit any page of your site. The “Ask AI” launcher should appear in the bottom corner.
Get your keys — your knowledge base ID and public client key (
bq_pk_...) are in the BeforeQuery dashboard under Knowledge Base → Integration. Add your WordPress site’s domain to the key’s origin allowlist.