> For the complete documentation index, see [llms.txt](https://aibotkit.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aibotkit.gitbook.io/documentation/embedding-your-chatbot/wordpress-plugin-guide.md).

# WordPress Plugin Guide

The AI BotKit WordPress plugin lets you connect your WordPress site to your AI BotKit account, embed chatbots, sync your content for training, and integrate with WooCommerce -- all without leaving your WordPress admin.

***

## Installation

### Method 1: Install from WordPress.org (Recommended)

1. Log in to your WordPress admin dashboard.
2. Go to **Plugins → Add New Plugin**.
3. Search for **"AI BotKit for Lead Generation"**.
4. Click **Install Now**, then click **Activate**.

### Method 2: Upload the ZIP File

1. Download the plugin ZIP from [wordpress.org](https://wordpress.org/plugins/ai-botkit-for-lead-generation/) or your AI BotKit account.
2. In WordPress, go to **Plugins → Add New Plugin**.
3. Click **Upload Plugin**.
4. Choose the ZIP file and click **Install Now**.
5. Click **Activate**.

***

## Connecting to Your AI BotKit Account

After activation, the plugin needs to connect to your AI BotKit SaaS account.

1. In your WordPress admin sidebar, click **AI BotKit**.
2. You'll see the **Onboarding** screen with a **Connect** button.
3. Click **Connect**. This opens a popup asking you to log in to your AI BotKit account.
4. Log in and authorize the connection.
5. Once connected, your site URL and a secure token are saved automatically.

{% hint style="info" %}
You only need to do this once. The connection persists until you manually disconnect.
{% endhint %}

***

## Dashboard Overview

After connecting, the AI BotKit menu appears in your WordPress admin with these sections:

```
AI BotKit
├── My Bots
├── Analytics
├── Content Sync
├── WooCommerce Enquiry
├── Settings
└── Logout
```

### My Bots

Lists all chatbots from your AI BotKit account. You can view bot names, status (Active/Inactive), deployment scope (Sitewide/Page-specific), messages, and sessions. Editing happens on the SaaS dashboard via the **Edit Bot** link.

### Analytics

Mirrors your SaaS analytics inside WordPress. See message counts, active sessions, and usage trends without leaving your site admin.

### Content Sync

Configure which post types should be automatically synced to your AI BotKit knowledge base.

### WooCommerce Enquiry

If you use WooCommerce, configure the Product Enquiry Integration (PEP) settings here.

***

## Content Sync

Content Sync sends your WordPress pages, posts, and products to AI BotKit so your chatbot can answer questions using your site content.

### What Gets Synced

| Content Type | Description                      |
| ------------ | -------------------------------- |
| Posts        | Blog posts and articles          |
| Pages        | Static pages like About, Contact |
| Products     | WooCommerce product pages        |

### How to Sync

1. Go to **AI BotKit → Content Sync**.
2. Enable **automatic content sync** using the toggle.
3. Select the post types you want to sync (Posts, Pages, Products, etc.).
4. Click **Save Settings**.
5. When you update a post of the selected types, it will be automatically synced to your knowledge base in the background.

{% hint style="info" %}

* The sync only applies for posts that are added in your chatbot's knowledge base.
* Only published posts are synced.
* Deleted posts are removed from your knowledge base automatically.
* Syncing happens in the background and won't slow down your website.
  {% endhint %}

***

## Embedding Your Chatbot

### Option 1: Site-Wide Embed

The easiest way to show your chatbot on every page:

1. Go to your AI BotKit SaaS dashboard.
2. Open your chatbot and go to **DEPLOY → Publish**.
3. Select the **WordPress** deployment method.
4. After connecting the plugin, your chatbot will appear automatically based on your deployment settings.

### Option 2: Shortcode

Use the shortcode to place the chatbot on specific pages or posts:

```
[ai_botkit_chatbot id="your-bot-id"]
```

1. Edit any page or post.
2. Paste the shortcode where you want the chatbot widget to appear.
3. Publish or update the page.

If you omit the `id` attribute, the default chatbot is used.

### Option 3: Share Link

Want to share your chatbot without embedding it? Use the direct link:

```
https://app.aibotkit.io/chatbot/your-bot-id
```

Anyone with this link can chat with your bot, even if it's not embedded on a website.

***

## Disconnecting

To disconnect the plugin from your AI BotKit account:

1. Go to **AI BotKit → Settings**.
2. Click **Disconnect**.
3. Confirm. Your connection token is removed.

Your chatbot will stop appearing on your site, and no new data will sync. Your AI BotKit account and chatbots remain unchanged.

***

## Troubleshooting

**The plugin says "Not Connected"**

* Make sure you've completed the onboarding and clicked Connect.
* Check that your AI BotKit account is active.

**My content isn't syncing**

* Go to **Content Sync** and make sure automatic sync is enabled.
* Make sure the correct post types are selected.
* Check that your site is accessible from the internet (localhost sites can't sync).

**The chatbot isn't showing on my site**

* Make sure you've activated the chatbot in the SaaS dashboard (DEPLOY → Publish).
* Check that the correct pages are selected.
* Try using the shortcode as a test.

***

## Related Topics

* [WordPress / Other Website Integration](/documentation/embedding-your-chatbot/wordpress-other-website-integration.md) -- Quick embedding options
* [KNOWLEDGE](/documentation/chatbot-editor/step-2-training.md) -- How your chatbot learns from synced content
* [Getting Your Embed Code](/documentation/embedding-your-chatbot/getting-your-embed-code.md) -- Copy and paste embed code manually


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aibotkit.gitbook.io/documentation/embedding-your-chatbot/wordpress-plugin-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
