How to Add ChatGPT or Gemini to WordPress Website: Step by Step 2026 Guide
Want to add an AI chatbot plugin to your WordPress website? 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 🚀
A proper AI chatbot isn’t like those old-school bots with pre-written answers. It uses ChatGPT or Gemini to understand what visitors are asking and searches through your actual website content to give relevant answers.
If you’re tech-savvy, check our article on how RAG-powered chatbots work.
What You’ll Need
- 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: Install a Chatbot Plugin
Now you need a WordPress plugin to connect everything. There are several options out there – AI Engine, Tidio, etc.

I use AI Chat & Search 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.
To install:
- Download the plugin from the website: AI Chat & Search Download
- Go to WordPress → Plugins → Add New → Upload Plugin
- Upload the zip file, install, activate
That’s it for the basic setup.
Step 2: Get Your 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:
Option A: OpenAI API Key (ChatGPT)
- Go to platform.openai.com and create an account
- Click on API Keys in the sidebar (or go directly to platform.openai.com/api-keys)
- Click “Create new secret key”
- Name it something like “WordPress Chatbot”
- 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 if you prefer watching.
Option B: Google Gemini API Key
Gemini has a free tier which is nice for testing:
- Go to aistudio.google.com/api-keys
- Click “Create API Key“
- Pick a Google Cloud project (or create one)
- 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
Now let’s hook everything up:
- In WordPress sidebar, find AI Chat & Search
- Go to Settings tab
- Paste your OpenAI or Gemini API key
- Pick your AI model (I like GPT-5.1 and Gemini Flash 2.5)
- Save

Step 4: Train the Chatbot
This is the important part – the chatbot needs to learn what’s on your site.
- Go to the Data Training tab
- Click “🚀 Start Training”
- 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.

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: hello@coffeeshop.com, 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 How It Responds
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: your@email.com
- 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: support@store.com, 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.

Step 6: Customize the Chat Widget (Optional)

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.

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.

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.
FAQ
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.
Want More Features?
If you need more, the Pro version ($59 one-time) adds:
- 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 AI Chat & Search you can read our comparison between different WordPress chatbots article →
Links: