Build an AI Chatbot Trained on Your Own WordPress Content

Updated: April 2, 2026 By: Marios

Build an AI Chatbot Trained on Your Own WordPress Content

Most WordPress chatbots are dumb. Not because the AI behind them is bad, but because they don’t know anything about your site.

A generic chatbot connected to ChatGPT can answer general knowledge questions all day long. But ask it “What’s your return policy?” or “Do you offer a Pro plan?” or “How do I set up your plugin with WooCommerce?” and it either hallucinates an answer or gives you a generic response that could apply to any business.

The fix isn’t a better AI model. The fix is giving the AI your actual content to work with.

That’s what RAG (retrieval-augmented generation) does. Instead of the AI guessing, it searches your real posts, pages, product descriptions, and uploaded documents for the relevant information before generating a response. The answer comes from your content, not from the model’s training data.

AI Engine, the most popular WordPress AI plugin with 80,000+ active installations, has RAG built in. You can build a chatbot that knows your entire site — trained on your actual WordPress content — without writing code, without setting up external infrastructure, and for a fraction of what subscription chatbot services charge.

This tutorial walks you through the entire build, from installation to a working chatbot that visitors can use on your site.


What we’re building

By the end of this tutorial, you’ll have a chatbot embedded on your WordPress site that searches your posts, pages, and (optionally) WooCommerce products before answering any question. It will answer based on your actual content, not generic AI knowledge. It will cite or reference specific pages when relevant. It will fall back gracefully when it doesn’t have relevant content. And it will cost roughly $5-20 per month in API fees depending on traffic — compared to $50-300 per month for subscription chatbot services like Tidio, Intercom, or Drift.


Part 1: Install and configure AI Engine

Step 1: Install AI Engine

Go to WP-Admin → Plugins → Add New. Search for “AI Engine.” Install and activate the free version by Meow Apps. The free version includes everything we need: chatbot, embeddings, content-aware mode, and function calling. The Pro version ($49/year) adds cross-site embedding, additional MCP tools, and priority support — nice to have, but not required for this build.

Step 2: Connect an AI provider

Go to Meow Apps → AI Engine → Settings. You need an API key from at least one AI provider. I recommend starting with OpenAI because AI Engine’s embedding features are most mature with OpenAI’s models. Enter your OpenAI API key under the AI Providers section.

If you’ve already configured providers through WordPress 7.0’s Connectors screen, AI Engine can detect and use those connections too. But for simplicity, entering the key directly in AI Engine’s settings works fine.

Step 3: Select your models

In the Settings tab, configure two models:

For chat (the model that generates responses): GPT-4o Mini is the sweet spot. It’s fast, cheap ($0.15 per million input tokens), and produces solid conversational responses. GPT-4o is better quality but costs 16x more — save it for when you’ve validated the chatbot works well.

For embeddings (the model that converts your content into searchable vectors): text-embedding-3-small is the standard choice. It costs $0.02 per million tokens, which means indexing an entire blog with 500 posts costs less than $1.


Part 2: Build your knowledge base with embeddings

This is the core of the RAG system. You’re going to convert your WordPress content into embeddings — numerical representations that the AI can search by meaning, not just keywords.

What embeddings actually do

Imagine someone asks your chatbot “How do I get a refund?” Your return policy page might be titled “Terms and Conditions” and never use the word “refund” — it uses “reimbursement” and “cancellation.” Traditional keyword search would miss it entirely. Embedding-based search understands that “refund,” “reimbursement,” and “cancellation” are semantically similar, and surfaces your Terms page as relevant context.

That’s the difference between a chatbot that says “I don’t have that information” and one that says “According to our Terms and Conditions page, you can request a reimbursement within 30 days of purchase.”

Step 4: Set up a vector database environment

Go to AI Engine → Embeddings. You need a vector database to store your embeddings. AI Engine supports several options:

OpenAI Vector Store is the simplest — it uses OpenAI’s own storage, so there’s no separate account to create. If you’re already using OpenAI for chat, this requires zero additional setup.

Pinecone is the most popular dedicated vector database. It has a generous free tier (up to 100,000 vectors) that’s sufficient for most WordPress sites. Create a free account at pinecone.io, get your API key, and add it in AI Engine’s Environments for Embeddings section.

Qdrant is an open-source alternative that can be self-hosted for complete data control.

For this tutorial, I’ll use OpenAI Vector Store because it requires no extra accounts and keeps everything in one place.

In AI Engine → Embeddings, click on Environments for Embeddings. Add a new environment with your chosen provider. Set the Minimum Score (I start with 70 — this means only embeddings with 70% or higher relevance will be used as context). Set Max Embeddings to 3-5 (the number of content chunks the AI will consider when answering each question).

Step 5: Sync your WordPress content

This is where the magic happens. AI Engine can automatically index your WordPress content into embeddings.

Go to AI Engine → Embeddings. Click Sync Content. Select which content types to index — at minimum, select Posts and Pages. If you run WooCommerce, add Products. The Pro version also supports Custom Post Types and uploaded PDFs.

Click Start Sync. AI Engine will process each piece of content, break it into chunks, generate embeddings via your chosen model, and store them in your vector database. For a site with 200 posts, this takes about 2-5 minutes and costs a few cents in API fees.

Once sync completes, you’ll see your embeddings listed with their titles and metadata. You can click on any embedding to inspect it, edit its content, or check how it performs in AI Search.

Step 6: Test your embeddings with AI Search

Before building the chatbot, verify that your embeddings actually work.

In the Embeddings section, switch from EDIT to AI SEARCH. Type a question your visitors would ask — something like “What’s your pricing?” or “How do I install your plugin?”

You’ll see a list of matched embeddings with their relevance scores. Scores appear in green if they meet your minimum threshold, meaning they’ll be used as context for AI responses. If the right content isn’t surfacing, you have two levers to adjust: lower the Minimum Score to be more inclusive, or refine the content in your posts to better answer the questions your visitors ask.

This testing step is critical. If your embeddings don’t return relevant results here, your chatbot won’t give good answers. Spend time getting this right before moving on.


Part 3: Create and configure the chatbot

Step 7: Create a new chatbot

Go to AI Engine → Chatbots. Click Add New. Give it a name — something like “Site Assistant” or your brand name.

Configure the basics:

AI Model: GPT-4o Mini (or whichever model you configured in Step 3).

System prompt: This is the instruction that shapes your chatbot’s personality and behavior. Here’s a template that works well:

“You are a helpful assistant for [Your Company Name]. Your job is to answer questions about [your products/services/content] based on the information provided to you. If you don’t have enough information to answer a question confidently, say so and suggest the visitor contact [your support email/phone]. Always be friendly, concise, and accurate. Never make up information that isn’t in your knowledge base. When referencing specific content, mention the relevant page or post title so the visitor can find more details.”

Take care with this prompt — it defines the boundaries of what your chatbot will and won’t do. The instruction to never make up information is particularly important. Without it, the AI will happily fabricate answers when it doesn’t find relevant embeddings.

Knowledge/Embeddings: Enable the embeddings environment you created in Step 4. This connects your chatbot to your content knowledge base.

Content Aware: Enable this option. It gives the chatbot additional context from the page the visitor is currently viewing. If someone asks a question while looking at a specific product page, the chatbot already knows which product they’re asking about.

Step 8: Style the chatbot

AI Engine includes a visual UI Builder for chatbot styling. You can customize colors to match your brand, the chat window size and position, the welcome message visitors see before typing, the chatbot name and icon, and whether it appears as a floating bubble or inline block.

Keep the styling clean and consistent with your site’s design. A chatbot that looks like it belongs on your site builds more trust than one that looks like a third-party widget pasted in.

Step 9: Embed the chatbot on your site

You have two options:

Shortcode: Add the chatbot to any page or post using AI Engine’s shortcode. This gives you control over exactly where the chatbot appears.

Gutenberg Block: AI Engine includes a chatbot block you can add through the block editor, which is useful for embedding the chatbot within specific content areas.

Floating widget: Most sites use the floating chat bubble in the bottom-right corner. This is configured in the chatbot’s appearance settings and appears site-wide.


Part 4: Add manual embeddings for critical information

Automated content sync handles your posts and pages, but some critical information might not exist as a full post. Things like your phone number, business hours, shipping costs, team members, and specific policies might be scattered across footer widgets, sidebar text, or page builders.

AI Engine lets you create manual embeddings for exactly this purpose.

Step 10: Add key business information manually

Go to AI Engine → Embeddings → Add New. Create individual embeddings for information your visitors ask about most frequently:

Contact Information. Title: “Company Contact Details.” Content: Your full address, phone number, email, business hours, and any special notes like “Closed on public holidays.”

Pricing/Plans. Title: “Pricing and Plans Overview.” Content: A clear summary of your pricing tiers, what each includes, and any current promotions. Even if you have a pricing page, a dedicated embedding with clean, structured pricing information performs better than the full page content.

Return/Refund Policy. Title: “Refund and Return Policy.” Content: Your complete policy in plain language. Visitors ask about this constantly, and a crisp embedding ensures the chatbot gives accurate answers every time.

After adding each manual embedding, test it with AI Search. Ask the questions visitors would ask and verify the right embeddings surface.


Part 5: Monitor, refine, and optimize

A chatbot isn’t a set-and-forget tool. The first version will handle most questions well, but you need to monitor what’s actually being asked and refine your content and settings based on real conversations.

Step 11: Review the Discussions log

Go to AI Engine → Discussions. Every chatbot conversation is logged here. Click on any discussion to see the full conversation, including which embeddings were used to generate each response.

Look for three patterns:

Questions the chatbot answered well. These confirm your embeddings are working. No action needed.

Questions the chatbot answered poorly. Click into the discussion to see which embeddings were used. If wrong embeddings surfaced, your content may need to be more specific, or your minimum score threshold might be too low (letting irrelevant content through). If no embeddings surfaced, you need to create content or manual embeddings that cover that topic.

Questions the chatbot couldn’t answer. These are content gaps. If visitors keep asking about something that isn’t in your content, that’s a signal to create a new post, FAQ entry, or manual embedding on that topic.

Review discussions weekly for the first month. Patterns emerge quickly, and each round of refinement makes the chatbot significantly better.

Step 12: Optimize for cost

Monitor your API usage on your provider’s dashboard (platform.openai.com for OpenAI). The two main cost drivers are:

Embedding sync costs are one-time per piece of content. Re-syncing only processes new or modified content. For most sites, this costs pennies per month.

Chat response costs scale with traffic. Each chatbot conversation uses tokens for the system prompt, the retrieved embeddings (context), the user’s question, and the AI’s response. A typical conversation uses roughly 1,500-3,000 tokens. At GPT-4o Mini’s pricing, that’s about $0.0003-0.0006 per conversation. Even 1,000 conversations per month costs less than $1.

If costs are higher than expected, check whether your Max Embeddings setting is too high (sending too much context per question), your system prompt is too long (unnecessary tokens on every request), or conversations are running too many turns (consider adding a turn limit in the chatbot settings).


WooCommerce-specific configuration

If you’re running a WooCommerce store, the chatbot becomes dramatically more useful with a few additional steps.

Sync your products

In Step 5, make sure you include Products in your content sync. AI Engine will index every product title, description, short description, and (in Pro) custom fields and attributes. This means visitors can ask “Do you have any blue shoes under $50?” and the chatbot will search your actual product catalog for matching items.

Enable function calling for cart actions

AI Engine supports function calling, which means the chatbot can do more than just answer questions — it can perform actions. With WooCommerce function calling enabled, the chatbot can show product details with links, display current prices and availability, and guide visitors through product selection based on their needs.

Function calling is configured in AI Engine → Settings → Function Calling. The setup involves defining which WordPress and WooCommerce functions the chatbot is allowed to call. Start with read-only functions (get product details, check stock) before enabling any write operations.

Write a WooCommerce-specific system prompt

Adjust your system prompt for e-commerce context:

“You are a shopping assistant for [Store Name]. Help customers find products, answer questions about specifications, pricing, and availability, and assist with order-related questions. When recommending products, always include the product name and a link to the product page. If a customer asks about something outside our product catalog, politely let them know and suggest they contact our support team at [email]. Never make up product details — only reference products that exist in your catalog.”


The cost comparison: why this beats subscription chatbots

Here’s the math that makes this approach compelling.

A typical subscription chatbot service (Tidio Pro, Intercom Starter, Drift) costs $29 to $79 per month for basic plans, scaling to $200+ for plans with AI features. These services host the chatbot, manage the AI, and provide a dashboard.

The AI Engine approach costs $0 for the plugin (free version) plus roughly $5-15 per month in API fees for a site handling 500-2,000 chatbot conversations per month. Even with the Pro version ($49/year = $4.08/month), your total monthly cost stays under $20 for most sites.

The quality difference has narrowed dramatically. Two years ago, subscription services offered significantly better AI than what you could self-host. In 2026, with GPT-4o Mini, Claude Haiku, and Gemini Flash available through WordPress’s AI provider system, the underlying models are the same ones powering the subscription services. The only difference is who manages the hosting and dashboard — and AI Engine handles that within your own WordPress admin.

The trade-off is support and managed hosting versus control and cost savings. If you want a fully managed solution with dedicated support, subscription services still have value. If you’re comfortable managing a WordPress plugin and monitoring API usage, the self-hosted approach saves $30-60 per month while giving you complete control over your data and chatbot behavior.


What to do next

Once your basic chatbot is running, there are several ways to extend it:

Add PDF knowledge. The Pro version of AI Engine lets you upload PDFs (product manuals, support guides, onboarding documents) directly into your embedding database. This is powerful for technical support chatbots that need to reference documentation.

Connect to MCP. AI Engine’s MCP support means external AI agents (Claude Desktop, Cursor, VS Code) can interact with your chatbot and your WordPress site through the same system. This opens up workflows like “Claude, check what questions my chatbot struggled with this week and draft content to fill the gaps.”

Build AI Forms. AI Engine’s Forms feature lets you create structured AI-powered interactions beyond free-form chat — things like product recommendation quizzes, support ticket classifiers, or lead qualification flows.

Set up usage limits. In the Statistics section, configure role-based usage limits to prevent abuse. You might allow unlimited chatbot usage for logged-in customers while limiting guest users to 10 conversations per session.

Read next