How to Add an AI Chatbot to WordPress: 3 Ways, From No-Code to Your Own Plugin

You can add an AI chatbot to WordPress in three ways. Install a chatbot plugin and paste in an API key; paste one line of script from a hosted widget that answers from your own pages; or build your own small plugin with Claude Code. The first is quickest to try, the second is the least maintenance, the third gives you full control. Whichever you pick, the hard part is not the widget. It is deciding what the bot is allowed to answer, and keeping your API key out of the browser.

Which of the three ways fits your site?

Chatbot plugin Hosted widget (one line) Your own plugin
Setup time Under an hour Minutes An afternoon to a few days
You maintain Plugin updates, API key, usage bill Almost nothing Everything
Answers from Whatever you configure, often your posts Your pages and the facts you approve Exactly what you code
Works on non-WordPress pages too No Yes No
Best for Trying a bot quickly Small businesses that want leads and bookings Developers and agencies with specific needs

Before choosing, check two things in the plugin directory or vendor page: when the plugin was last updated, and whether calls to the AI provider go through your server or straight from the visitor's browser. The second one decides whether your API key is safe.

What should the chatbot answer, and what should it refuse?

Every way of adding a bot needs the same instructions underneath. Write them before you install anything. Claude is good at drafting them from your own site:

I am adding an AI chatbot to my website [mysite.com], a [DENTAL CLINIC IN LEEDS]. Here is the text of my key pages: [PASTE: services and prices, opening hours, location and parking, booking policy, FAQ] Write the chatbot instructions: 1. A list of facts the bot may state, each copied from my pages, with the page it came from. 2. Questions it must NOT answer, with the exact reply it gives instead (medical advice, diagnosis, anything about a specific patient, prices not on my site). 3. When to hand over to a human, and the exact handover message, asking for name and phone or email. 4. Tone: [warm, short, no emojis], answers under 60 words unless asked for detail. 5. What to say when it does not know: never guess a price, time or policy. Then list every question a visitor is likely to ask that my pages do not answer, so I can add the answer to the site first.

The last step is the useful one. A bot that answers from your pages exposes every gap in them, and it is better to fix the page than to let the bot improvise. For industry-specific versions of these instructions, the catalog has chatbot prompts for clinics, salons, restaurants, law firms and more.

The instructions every chatbot needs
FAQ Chatbot Prompt for Claude and ChatGPT
FAQ Chatbot Prompt $19 one-time · or in Library

The system prompt half of any chatbot: how it answers from your facts, what it says when it does not know, and when it hands the visitor to a person. Drop it into whichever plugin or widget you choose.

Get the FAQ Chatbot Prompt →

Way 1: install a chatbot plugin

  1. In WordPress, go to Plugins → Add New and search for an AI chatbot plugin. Prefer one updated in the last few months with a clear statement of where requests go.
  2. Create an API key with the AI provider the plugin supports, set a monthly spending limit in that provider's console, and paste the key into the plugin settings.
  3. Paste the instructions from the prompt above into the plugin's system prompt or "persona" field.
  4. If the plugin can index your content, limit it to the pages you actually want quoted. Old blog posts with outdated prices are the most common source of wrong answers.
  5. Test with the ten questions customers ask most, then with five you want refused.

Watch the bill for the first week. A plugin that sends your whole site as context with every message can cost far more per conversation than you expect. Our token cost calculator shows how quickly repeated context adds up.

Way 2: paste a hosted widget

A hosted widget runs on someone else's server and appears on your site through one script tag. You do not handle an API key at all. Our own AI Receptionist works this way: your Claude reads your public pages through the KissMySkills connector, drafts short answers from your own prices, hours and policies, asks you about anything not on the site, and gives you one line of code. It answers questions, books visits into free slots and hands everything else to you as a lead.

The free plan covers 50 conversations a month on one website with lead capture, and shows a small "Powered by KissMySkills" line. AI CRM at $15 a month raises that to 1,000 conversations a month without the branding. It is website chat only; it does not answer phone calls.

To add any script tag to WordPress without editing theme files, use a header-and-footer code plugin and paste the line into the footer section, or, on a block theme, ask your developer to add it to the footer template part. Editing footer.php directly works too, but a theme update will wipe it.

Way 3: build your own plugin with Claude Code

If you want full control over data, design and cost, a small custom plugin is less work than it sounds, and Claude Code can write most of it. The part to get right is the architecture: the browser talks to your WordPress REST endpoint, and only your server talks to the AI provider.

Build a minimal WordPress plugin for an AI chat widget. WordPress [6.6], PHP [8.2]. Requirements: - Settings page under Settings -> AI Chat, storing the API key in wp_options. Never print the key to the front end. - A REST route POST /wp-json/aichat/v1/message with a permission_callback that verifies a nonce. Rate limit: [20] messages per IP per hour using transients. - The route calls the AI provider with wp_remote_post from the server, with my system prompt from the settings page, and returns only the reply text. - A shortcode [ai_chat] and a block that render the widget. Plain JS, no build step. - Escape all output, sanitize all input, uninstall.php that removes the options. Work in small steps. After each file, tell me how to test it in a local WordPress before moving on. At the end, list what this plugin does NOT handle yet (streaming, page caching of the nonce, GDPR consent) so I can decide.

Two problems catch most first builds. A full-page cache can serve an expired nonce, so the endpoint starts returning 403 for visitors; and wp_remote_post returns only after the whole reply arrives, so streaming needs a different approach. The skill below walks through both.

The skill for Way 3
Chatbot Builder Skill for WordPress for Claude and ChatGPT
Chatbot Builder Skill for WordPress $19 one-time · or in Library

A build guide, not a plugin. Open it in Claude Code or Cursor and it builds the plugin with you: settings page, a REST route with a real permission check, nonces, a shortcode and a block, with the API key kept on the server where it belongs.

Get the WordPress Chatbot Builder →

What mistakes make a WordPress chatbot a liability?

  • The API key in front-end JavaScript. Anyone who opens view-source can copy it and run up your bill. If a plugin calls the provider from the browser, do not use it.
  • No spending limit. Set a monthly cap in the provider console before the bot goes live.
  • Answering from everything. Indexing every old post means quoting old prices. Limit sources to current pages.
  • No handover. A bot that cannot pass a visitor to a person loses exactly the leads worth having.
  • Collecting personal data without saying so. If the bot asks for names and phone numbers, your privacy policy needs to cover it.
One file, or the whole library
Every skill in this guide, loaded inside your AI for $9 a month

Buying a file is the right call if you need one specialist once. If you run a site and also need copy, SEO or support replies written in the same voice, the KissMySkills Library is cheaper: one connector puts all 2,500+ skills, prompt packs and agents inside Claude, ChatGPT, Claude Code or Cursor, and the skill loads when you ask for it by name. Library is $9 a month or $59 a year, starts with a free trial, no card needed, and you can cancel anytime.

Start your free trial Why a subscription beats buying files · See plans

How do you load a skill into Claude?

Two ways. With a one-time file, add it in the Claude app under Customize → Skills (code execution has to be on, under Settings → Capabilities), or paste its contents into a Claude Project's instructions, a ChatGPT custom GPT or a Gemini Gem. Our step-by-step install guide covers each app. With Library, you connect KissMySkills to Claude, ChatGPT or Cursor once, then ask for the specialist by name in the chat you already use.

In summary:

Write the bot instructions first, from your own pages. Then choose: a plugin to try quickly, a hosted widget like the AI Receptionist (free for 50 conversations a month) if you want answers and bookings without maintenance, or your own plugin built with the Chatbot Builder Skill for WordPress ($19) if you want full control. In every case, keep the API key on the server.

AI Skill · Works with Claude & ChatGPTChatbot Builder Skill for WordPress for Claude and ChatGPT

Chatbot Builder Skill for WordPress

Your own WordPress chatbot plugin, built with Claude Code step by step: server-side API key, REST route with permission checks, shortcode and block.

$19
Get the WordPress Chatbot Builder →

Or get it with every other skill in Library, $9 a month. Free trial, no card needed.

KissMySkills is a marketplace of 2,500+ AI skills, agents, prompt packs & free tools for Claude, ChatGPT & any AI chat.

Frequently asked questions

What is the easiest way to add an AI chatbot to WordPress?

A hosted widget you paste as one script tag. You do not manage an API key or plugin updates. Install a header-and-footer code plugin, paste the line into the footer, and the chat button appears on every page.

Is it safe to put my OpenAI or Claude API key in a WordPress plugin?

Only if the plugin calls the AI provider from your server. If the key appears in front-end JavaScript, anyone can copy it from the page source. Set a monthly spending limit in the provider console either way.

How much does a WordPress AI chatbot cost to run?

It depends on how many conversations you get and how much context is sent with each message. Hosted widgets often have a free tier; the KissMySkills AI Receptionist is free for 50 conversations a month on one site, and AI CRM at $15 a month covers 1,000.

Can Claude build a WordPress chatbot plugin for me?

Yes. With Claude Code you can build a small plugin with a settings page, a REST endpoint with nonce and permission checks, and a shortcode or block. Build in small steps and test each file in a local WordPress before going live.

What should a website chatbot not answer?

Anything not on your own pages, such as unpublished prices, plus professional advice in regulated fields like medicine or law, and questions about specific customers. Give it an exact reply for each and a clear handover to a human.

Related guides

實踐這一點

Or get every skill with Library See plans →

~/get-started

實用的 Skills。不說空話。

瀏覽商店中的每個技能、prompt 套件和 agent。

瀏覽所有技能 →或試試免費工具