Add AI to WordPress
Integrate the kapa.ai chat widget into your WordPress site to enable users to ask natural language questions about your product, significantly enhancing user experience by providing quick and accurate answers.
Prerequisites
Before adding the widget to your WordPress site, you'll need to:
- Ensure you have a kapa.ai project set up with your knowledge sources added
- Follow the general installation instructions to enabled your domain and obtain your
Website ID
Installation
Using a Plugin
-
Install a Header and Footer Script Plugin:
- Go to your WordPress admin dashboard.
- Navigate to Plugins > Add New.
- Search for "Insert Headers and Footers" or a similar plugin.
- Install and activate the plugin.
-
Add the Widget Script:
- Go to Settings > Insert Headers and Footers.
- In the Scripts in Header section, add the following script:
<script
async
src="https://widget.kapa.ai/kapa-widget.bundle.js"
data-website-id="XXX-XXX-XXX"
data-project-name="PROJECT_NAME"
data-project-color="#HEX_COLOR_CODE"
data-project-logo="https://LINK_TO_LOGO.com/logo.png"
></script>
- Save Changes: Click Save to apply the changes.
Manual Method
If you prefer not to use a plugin, you can manually add the script to your theme:
-
Edit the Theme:
- Go to Appearance > Theme Editor.
- Select the
header.php
file from the list on the right.
-
Insert the Script:
- Locate the closing
</head>
tag. - Insert the script code just before the
</head>
tag.
- Locate the closing
-
Update File: Click Update File to save your changes.
Customization Options
To tailor the widget to your brand and specific needs, visit our Configuration page. There, you'll find detailed instructions on how to adjust colors, logos, and other widget properties.