---
title: "How to Add ChatGPT or Gemini to WordPress – Train Your Chatbot"
id: "27449"
type: "post"
slug: "how-to-add-chatgpt-or-gemini-to-wordpress-step-by-step-guide"
published_at: "2025-11-30T00:24:58+00:00"
modified_at: "2026-05-11T13:24:46+00:00"
url: "https://purethemes.net/how-to-add-chatgpt-or-gemini-to-wordpress-step-by-step-guide/"
markdown_url: "https://purethemes.net/how-to-add-chatgpt-or-gemini-to-wordpress-step-by-step-guide.md"
excerpt: "Looking for a ChatGPT plugin for WordPress ? The right plugin doesn’t just connect ChatGPT to your site – it trains the AI on your actual content so it gives accurate, relevant answers. Here’s how to set it up and..."
taxonomy_category:
  - "Chatbot for WordPress"
  - "Guides"
  - "WordPress"
  - "WordPress AI Tools"
---

Looking for a **ChatGPT plugin for WordPress**? The right plugin doesn’t just connect ChatGPT to your site – it trains the AI on **your actual content** so it gives accurate, relevant answers.

Here’s how to set it up and train it in under 10 minutes. **You’re in the right place.** In this step-by-step tutorial, I’ll show you exactly**how to integrate ChatGPT (OpenAI) or Google Gemini into WordPress**, even if you’ve never done anything like this before.

No coding required. Takes about 10 minutes. Let’s do it 🚀

Purio Assistant

Start a new chat

Contact Human

How it works?

1

0:00

### Contact Us

## What is a ChatGPT WordPress Plugin?

It’s AI powered WordPress plugin that connects OpenAI’s ChatGPT to your website, letting visitors interact with an AI assistant right on your pages.

A **trained ChatGPT plugin** goes further: it **“learns” your actual content** – pages, blog posts, products, FAQs – and uses that knowledge to answer questions. When someone asks “Do you ship to Canada?” or “What’s your return policy?”, the AI pulls answers from your site, not from thin air.

This is called **RAG (Retrieval-Augmented Generation)**. The chatbot searches your content first, then feeds it to ChatGPT to generate a relevant, accurate response. The result: answers that are specific to your business, not generic AI guesses.

If you’re tech-savvy, check our article on [how RAG-powered chatbots work](https://purethemes.net/how-ai-chatbots-work-rag-vector-embeddings-explained/)
.

**What to look for in a ChatGPT WordPress plugin:**

- **Content training** — can it learn from your pages, posts, and products?
- **WooCommerce support** — does it understand product filters, stock, pricing?
- **Knowledge sources** — can you point it to specific pages (shipping policy, terms) for sensitive topics?
- **Custom instructions** — can you set the tone, persona, and guardrails?
- **Multiple AI models** — **ChatGPT**is great, but having **Gemini** as an option is useful

## What Do You Need to Add ChatGPT or Gemini to WordPress?

- WordPress website 🙂
- An AI chatbot plugin (I’ll cover options below)
- API key from OpenAI or Google (takes 2 min to create)
- About 10-15 minutes

**That’s it. Let’s go.**

## Step 1: Choose a OpenAI Chatbot Plugin for WordPress

Now you need a WordPress plugin to connect everything. There are several options out there – AI Engine, Tidio, etc.

[https://purethemes.net/ai-chatbot-for-wordpress/](https://purethemes.net/ai-chatbot-for-wordpress/)
I use [PurioChat WP chatbot plugin](https://purethemes.net/ai-chatbot-for-wordpress/)
 which has a free version you can start with.**It’s truly WordPress native**and works with any WordPress theme and trains the chatbot on your actual site content.

[Download Plugin →](https://purethemes.net/?download=ai-chat-search)
**To install:**

1. Download the plugin from the website: [PurioChat Download](https://purethemes.net/ai-chatbot-for-wordpress/)
2. Go to **WordPress → Plugins → Add New → Upload Plugin**
3. **Upload the zip** file, install, activate

That’s it for the basic setup.

## Step 2: Get a ChatGPT or Gemini API Key

First thing – you need an **API key to connect your site to ChatGPT or Gemini.** This is basically a password that lets your chatbot talk to the AI.

You can choose either OpenAI (ChatGPT) or Google (Gemini). Both work great. Here’s how to get each:

If you prefer managing multiple AI providers from one place, read the [OpenRouter compatible WordPress chatbot](https://purethemes.net/openrouter-api-wordpress-chatbots/)
 guide before picking your model setup.

### Option A: OpenAI API Key (ChatGPT)

1. Go to [platform.openai.com](https://platform.openai.com) and create an account
2. Click on API Keys in the sidebar (or go directly to [platform.openai.com/api-keys](https://platform.openai.com/api-keys) )
3. Click “Create new secret key”
4. Name it something like “WordPress Chatbot”
5. **Copy it immediately** – you won’t see it again

Then add some credits – go to Billing → Add credits. Minimum is $5 which gets you roughly:

- ~2,000 messages with GPT-4.1 Mini
- ~5,000 messages with GPT-5.1
- ~3,000 messages with GPT-4.1

For most small sites, $5 lasts foreve, litierally. OpenAI uses prepaid credits so you can’t accidentally overspend.

There’s a [2-minute video tutorial here](https://youtu.be/J_Mlp7BjtP8)
 if you prefer watching.

### Option B: Google Gemini API Key

**Gemini has a free tier which is nice for testing:**

1. Go to [aistudio.google.com/api-keys](https://aistudio.google.com/api-keys)
2. Click “**Create API Key**“
3. Pick a Google Cloud project (or create one)
4. **Copy your key**

**Done. Literally 30 seconds.**

**Free tier limits**: 10 requests per minute, 250 requests per day for Gemini 2.5 Flash. Good enough for testing and low-traffic sites.

For production use you’ll want to enable billing. Gemini 2.5 Flash costs about $0.30 per million input tokens – very cheap – similar to ChatGPT ~$5 per 5000 messages. Just keep in mind Gemini bills you after the cycle (not prepaid like OpenAI), so watch your usage.

## Step 3: Connect Your API Key in WordPress

Now let’s hook everything up:

1. In WordPress sidebar, find **PurioChat**
2. Go to **Settings** tab
3. Paste your OpenAI or Gemini API key
4. Pick your AI model (I like **GPT-5.1** and **Gemini Flash 2.5**)
5. Save

[https://purethemes.net/wp-content/uploads/2025/11/image-38.png](https://purethemes.net/wp-content/uploads/2025/11/image-38.png)
## Step 4: Train the Chatbot

This is the important part – the chatbot needs to learn what’s on your site.

1. Go to the **Data Training** tab
2. Click **“🚀 Start Training”**
3. Wait for it to finish

The plugin scans your content and creates embeddings (basically a searchable index) that the AI uses to find relevant stuff when answering questions.

[https://purethemes.net/wp-content/uploads/2025/11/image-40.png](https://purethemes.net/wp-content/uploads/2025/11/image-40.png)
**Use your system prompt as a cheat sheet.** In free version you get 1000 characters – enough to include your contact info, shipping policy, return policy, business hours, and answers to common questions. The AI uses this to answer without even searching your database.

Free version allows training on all blog posts. You can add some posts and use them as a source about your website and make them also SEO optimized articles. **Win-win!** Pro version unlocks pages, products, Custom Post Types, and uploaded PDFs.

Example:

```
We're a coffee roastery based in Portland. We ship fresh beans weekly.

SHIPPING: Free over $35, otherwise $5.99. Ships within 2 days.
RETURNS: Full refund within 14 days if unopened.
CONTACT: [email protected], Mon-Fri 9-5 PST

Popular: Ethiopian Yirgacheffe ($18), House Blend ($14)
Subscriptions: 10% off, cancel anytime at account page.
```

The AI will use this info to answer questions even without searching your database. Someone asks “do you offer subscriptions?” – it already knows.

## Step 5: Customize ChatGPT Responses for Your WordPress Site

### Keep Answers Short

Add this to your system prompt:

```
Keep answers brief, under 100 words. Link to relevant pages for details.
```

Shorter responses = quicker responses.

Out of the box the chatbot works fine, but you can make it way better by telling it about your site. Find the custom instructions or system prompt field and add some context:

```
IMPORTANT:
- This is [describe your site - what you sell/do]
- If users ask about [common question], tell them [answer]
- If users ask about [another common thing], explain [how it works]

CONTACT INFO:
- Email: [email protected]  
- Phone: your number
- Hours: when you're available
```

For example, an online store might use:

```
IMPORTANT:
- This is an online furniture store with worldwide shipping.
- If users ask about orders, they can track in "My Account" or email support.
- If users ask about returns, we accept returns within 30 days.

CONTACT: [email protected], Mon-Fri 9am-5pm
```

### Quick Fix for Empty Results

If the chatbot returns nothing when someone asks for “good headphones” or “nice restaurant” – it might be auto-filtering for high ratings. Add this line:

```
Don't apply a rating filter unless the user specifically asks for it.
```

[https://purethemes.net/wp-content/uploads/2025/11/image-41.png](https://purethemes.net/wp-content/uploads/2025/11/image-41.png)
### **Add Knowledge Source (Pro)**

**This is additional feature** that directs the AI to use a specific page or document when answering questions about a particular topic. Useful for sensitive topics where accuracy matters most (e.g.  
legal pages, shipping policies, terms of service).

ScPurioChat → AI Chat → AI Tools → System Prompt → Add Knowledge Source

Click the **Add Knowledge Source** button below the System Prompt textarea, fill in the  
topic and select a page/document, and the instruction is automatically added to your  
system prompt.

- Searches across pages, blog posts, PDF documents, and external pages
- Max 2 posts can be referenced per AI search query
- Content is fetched directly (up to 8000 characters per post) and combined with normal AI search results
- The instruction is translatable – works in any language Example instructions (auto-generated): When user asks about shipping, delivery, returns – search in post ID 99 (“Shipping Policy”). When user asks about refunds, cancellations – search in post ID 105 (“Terms & Conditions”).

**How it works:** When a visitor asks about a matching topic, the AI fetches the referenced page content directly and also runs a normal search across all trained content – giving the most accurate answer possible from the exact source you specified.

## Step 6: Customize the WordPress Chatbot Widget

[https://purethemes.net/wp-content/uploads/2025/11/chatbot-color-schemes.jpg](https://purethemes.net/wp-content/uploads/2025/11/chatbot-color-schemes.jpg)
The basic setup is done, but there’s a bunch of options to make the chatbot fit your site better. Head to the **AI Chat** tab in settings.

Need more than text chat? The separate guide to [WordPress chatbots with image and voice input](https://purethemes.net/wordpress-chatbots-with-image-and-speech-to-text-input/)
 covers when vision and speech-to-text are worth adding.

[https://purethemes.net/wp-content/uploads/2025/11/image-42.png](https://purethemes.net/wp-content/uploads/2025/11/image-42.png)
### Basic Settings

- **Chatbot Name** – what shows in the chat header (default: “Assistant”)
- **Welcome Message** – the first message visitors see when they open the chat. Something like “Hello! I can help you find products or answer questions. What are you looking for?”
- **AI Model** – pick your preferred model like GPT 5.1 or Gemini 3 Pro / 2.5 Flash
- **Maximum Results** – how many items to show in search results (5-50)

### Widget Appearance

You can customize how the floating chat bubble looks:

- **Custom Button Icon** – upload your own SVG icon
- **Welcome Bubble Message** – the little text that pops up above the chat button (“Hi! How can I help you?”)
- **Popup Width/Height** – resize the chat window (default 390x600px)
- **Button Color & Primary Color** – match your brand colors
- **Dark, Light or Auto Color Scheme**
- **Initial Header Style** – Choose simple (default) header (top section of chat window) or header with background image for initial header view (before first message). This works only with floating widget, not shortcodes. Allows customize chat window visually to match your brand.

### Privacy & Access Options

- **Require Login to Use Chat** – only logged-in users can chat (useful for membership sites)
- **Enable Chat History Tracking** – saves conversations for analytics (auto-deleted after 30 days)
- **Show Terms of Use Notice** – adds a terms notice for compliance
- **Hide Chat on Selected Pages** – disable the widget on specific pages like Cart, Checkout, My Account

### Using Shortcode

Don’t want the floating widget? Use the shortcode instead:

```
[ ai_chat ]
```

You can customize it with parameters:

```
[ ai_chat height="600px" style="2" ]
```

This lets you embed the chat anywhere – in a page, sidebar, or specific sections of your site.

[https://purethemes.net/wp-content/uploads/2025/11/image-43.png](https://purethemes.net/wp-content/uploads/2025/11/image-43.png)
## That’s It – You’re Done! 🎉

Seriously, that’s the whole process. Your site now has an AI chatbot that:

- Understands natural language questions
- Searches your actual content for answers
- Works 24/7 without you doing anything

Go test it out. Ask it some questions about your site and see how it does. Tweak the system prompt if needed. Already using another plugin? I compared [AI Engine and WPBot alternatives for WordPress](https://purethemes.net/ai-engine-and-wpbot-alternatives-for-wordpress/)
 and a separate [MxChat alternative for WordPress](https://purethemes.net/mxchat-chatbot-alternative-wordpress/)
 if you want the migration angle before choosing.

If you’re setting this up for client sites, the [WordPress chatbots for agencies](https://purethemes.net/wordpress-chatbots-for-agencies/)
 article breaks down the licensing and resale angle.

## ChatGPT and Gemini WordPress Setup Questions

****How much does this cost to run?**** API costs are typically $5-15/month for small-to-medium sites. Way less than most subscription chatbot services.

 **Will it slow down my site?** Nope. Chatbot loads asynchronously, AI processing happens on OpenAI/Google servers. Searching site content happens on your server via embeddings cosine similarity calculation (nerd alert)

 ****Do I need to build conversation flows or decision trees?**** No. You just write instructions in plain language – like briefing a new employee. “Keep a friendly tone, suggest WhatsApp if they can’t find what they need, avoid technical jargon.” The AI figures out the rest.

 ****Is it multilangual?**** Works in any language. You can even tell it to translate queries before searching if your content is in one specific language.

 ****Can someone spam the chatbot?**** No. There’s two layers of rate limiting – client-side (browser cache) and server-side. So even if someone tries to abuse it, they’ll hit limits early.

## When Do You Need a Full WordPress AI Chatbot Plugin?

If you need more, the [Pro version](https://purethemes.net/ai-chatbot-for-wordpress/)
 ($49 one-time) adds:

If you’re replacing a hosted widget instead of starting from scratch, compare the WordPress-native setup with these SaaS alternatives: [Chatbase](https://purethemes.net/chatbase-com-alternative-for-wordpress-sites/)
, [ChatBot.com](https://purethemes.net/chatbot-com-alternative-for-wordpress-sites/)
, [Jotform](https://purethemes.net/jotform-chatbot-alternative-for-wordpress-sites/)
, and [Lyro AI/Tidio](https://purethemes.net/alternative-to-lyro-ai-tidio-chatbot/)
.

- **Chat conversation history** – see what visitors are asking
- **Posts & pages search** – AI searches through all your content
- **WooCommerce filters** – filter by price, stock, ratings, sale items
- **Product cards in chat** – show actual product cards, not just text
- **Custom post types** – train on any content type
- **PDF training** – upload manuals, FAQs, docs
- **Remove branding** – no “powered by” label

If you’d like to check alternatives to PurioChat you can read our [comparison between different WordPress chatbots article →](https://purethemes.net/best-chatbot-plugins-for-wordpress-comparison/)
 If you want a more focused breakdown of this exact use case, see our guide to the best [ChatGPT plugin for WordPress](https://purethemes.net/chatgpt-plugin-for-wordpress/)
. If you’re still comparing chatbot approaches before installing anything, this broader [WordPress chatbot setup guide](https://purethemes.net/chatbot-for-wordpress-complete-guide/)
 explains the main use cases, benefits, and trade-offs.

**Links:**

- [Download Plugin](https://purethemes.net/ai-chatbot-for-wordpress/)
- [OpenAI API Key Tutorial](https://docs.purethemes.net/listeo/knowledge-base/how-to-create-open-ai-api-key/) ([video](https://youtu.be/J_Mlp7BjtP8) )
- [Gemini API Key Tutorial](https://docs.purethemes.net/listeo/knowledge-base/how-to-create-gemini-ai-api-key/)