ChatHearth – AI Chatbot
An AI chatbot for WordPress that answers from your own content and your shop, powered by the AI Provider for OpenAI plugin.
Install in
ChatHearth adds an AI chatbot to your WordPress site. Visitors ask a question in a chat window and get an answer from your own pages, posts and, with WooCommerce, your products, with links to the pages the answer comes from. It uses the AI connection that WordPress itself manages, through the AI Provider for OpenAI plugin, so your API key is never entered or stored in ChatHearth.
Requirements. WordPress 7.0 or newer, PHP 7.4 or newer, and the AI Provider for OpenAI plugin with an OpenAI API key under Settings Connectors. WordPress will not activate ChatHearth until that plugin is installed and active. WooCommerce is optional: the shop features only appear on a site that has it.
The chat widget. A launcher in the corner of every public page, as an icon or as a pill with your own label, opens a chat panel. The panel shows your welcome message and suggestions, a “Tell me about this page” suggestion where the page is known, formatted answers (headings, lists, tables, code and safe links), the sources of an answer and product cards. It follows your appearance settings and keeps its look on any theme, works with the keyboard and screen readers, mirrors for right-to-left languages and fills the screen on phones. The launcher only appears when the chat is switched on and OpenAI is ready, and never in the admin area or on the login page.
Website grounding. The assistant answers only about this website. With every message it is given a short summary of your public pages (and, with WooCommerce, your store and its product categories), so it can answer from your site and politely refuse unrelated questions. When a visitor asks about “this page” or “this product”, it also reads the public content of the page they are on. A source, and for a product a product card, is shown only when the answer links to that page. Your own instructions in the AI Settings tab are added after these rules and cannot widen the scope. Drafts, private and password-protected content are never used.
Knowledge Base. You choose which public content the assistant can learn from: content types (posts, pages, products and custom types), categories and tags, a summary of your site and, with WooCommerce, a summary of your store. The content is indexed in the background, in small steps, so even a site with thousands of posts never times out, and the Knowledge Base tab shows how far indexing has got. Later changes (new, edited, unpublished and deleted items, renamed categories, price and stock changes) update only what really changed, so nothing is paid for twice. Passages are stored once, in a compact form, in your WordPress database. Optional protected markdown copies of your content can be kept in your uploads folder. The index needs no extra server or account. Each question then finds the passages that match it best, in your language or another, and the answer lists the pages it links to under Sources. Questions that compare things use twice as many passages. The built-in store suits about 10,000 passages (roughly 2,500 pages); larger sites should use a persistent object cache or plug in another store through the chathearth_vector_store filter. A search never takes longer than about 2 seconds: it stops reading and uses the best passages found so far.
Shop. With WooCommerce, the assistant shows products as cards: the products a visitor names, the product of the page they are on and the products it finds in your Knowledge Base. A card shows the picture, price and stock, a choice of option for a variable product and an Add to cart button that works for guests too, followed by View cart and Checkout links. Comparisons show exactly the products that were named and use their real price, stock, categories and attributes. Payment always happens at your store’s own checkout. Nothing shop-related appears on a site without WooCommerce.
Protection and moderation. Visitors and the whole site have rate limits, so a burst of messages cannot run up your bill. When the site-wide limits are hit repeatedly you get an alert, the chat can switch itself off, and a one-click link switches it back on. Content moderation refuses a message that holds a blocked word or phrase (whole words, in any language) or that OpenAI moderation flags, with a reply you wrote, before any answer is generated. Optional Google reCAPTCHA v3 asks a visitor to verify once before chatting.
Protection extras. Logged-in users get their own message limits, counted per account instead of per network, and you can give a role a larger allowance (×1 to ×10). A list of blocked addresses and ranges, IPv4 and IPv6, refuses unwanted visitors before anything else happens. An invisible bot trap catches programs that fill in every form field. One button clears all rate-limit counters, for example after a false alarm. Your “limit reached” message can show the limit and the time window with {limit} and {window}. Behind a CDN or reverse proxy such as Cloudflare, turn on the trusted proxy and list its addresses, so limits and blocking use the real visitor address.
The conversation is kept in the visitor’s browser and removed after 24 hours without a new message, or sooner when the visitor clears the chat. The Knowledge Base setting is off by default. Nothing is sent to OpenAI or Google when a page loads: only a visitor’s message, or the changes you make to the Knowledge Base, start a request (see External services).
External services
ChatHearth sends text to OpenAI so that it can write a reply, check a message and search your content, and, when you turn it on, asks Google to check that a visitor is human. Nothing is sent when a page loads: only a visitor’s message, a visitor pressing Continue, or the changes you make to the Knowledge Base start a request, and nothing is sent while the chat is switched off. ChatHearth never reads, stores or passes on your OpenAI API key.
OpenAI chat replies, through the AI Provider for OpenAI plugin
- What is sent: the visitor’s message, the recent part of the conversation (up to the number of messages you allow in the settings) and the instructions you wrote in the AI Settings tab.
- Website grounding: with each message, ChatHearth also sends a summary of your public pages (their titles and addresses, up to 40) and, with WooCommerce, your store and up to 50 product categories, and the public content of the page the visitor is on. Drafts, private and password-protected content is never sent, and content is read as a guest sees it. The summary is kept on your server for up to 12 hours.
- Shop facts: when WooCommerce is active, the facts of the products named in a message or found in your Knowledge Base (name, price, stock, categories, attributes and short description) go with the message.
- When: only when a visitor sends a message. Nothing is sent when a page loads, and nothing is sent while the chat is switched off.
- Where:
https://api.openai.com/v1/, through WordPress’s own AI Client and the AI Provider for OpenAI plugin, which makes the request with your key and has its own disclosure: AI Provider for OpenAI. - Not stored: ChatHearth does not store messages, conversations or replies.
- OpenAI’s terms and privacy policy: Terms of use and Privacy policy.
Knowledge Base indexing and search
- What is sent: The public content selected in the Knowledge Base settings is sent to the OpenAI embeddings service when it is indexed and when it changes, only while the Knowledge Base is on and OpenAI is connected. Each item is sent as readable text (its title, address, text, categories and, for a product, its price, stock and attributes), in batches. Drafts, private and password-protected content, comments and author e-mail addresses are never sent.
- Where:
https://api.openai.com/v1/embeddings. WordPress’s AI Client has no embeddings request, so ChatHearth sends this request to OpenAI’s address itself, signed by the AI Client’s own OpenAI connection (the AI Provider for OpenAI plugin). ChatHearth never reads, stores or passes on your API key, and no setting or filter changes the address. Plugin Check lists this as a direct integration. - Visitor questions: While the Knowledge Base is on and OpenAI is connected, each visitor question is sent to the OpenAI embeddings service to find matching passages. ChatHearth does not store the question for this. It is sent once for each message that passed the protection checks, and not for a message that was refused.
- When: the content is sent in the background after you turn the Knowledge Base on, change its sources or the passage size, or change an item. A question is sent when a visitor sends a message. Nothing is sent while the Knowledge Base is off.
- Stored: the vectors and the readable text of your own public content stay in your WordPress database. The index holds no visitor or account data.
- OpenAI’s terms and privacy policy: Terms of use and Privacy policy.
OpenAI moderation
- What is sent: the new message and up to two earlier visitor messages of the same chat, never the assistant’s replies. Only texts that were not checked in the last 24 hours are sent.
- Where:
https://api.openai.com/v1/moderations. WordPress’s AI Client has no moderation request, so ChatHearth sends this request to OpenAI’s address itself, signed by the AI Client’s own OpenAI connection. ChatHearth never reads, stores or passes on your API key. Plugin Check lists this as a direct integration. - When: only when a visitor sends a message and both “Check messages before they reach the AI” and “Use OpenAI moderation” are on. If OpenAI does not answer in the time you choose, the message is sent without the check.
- Remembered: the result of a check is remembered for 24 hours under a salted hash. The text itself is never stored.
- OpenAI’s terms and privacy policy: Terms of use and Privacy policy.
Google reCAPTCHA v3
- When Google is contacted. The owner must configure both reCAPTCHA keys. The browser loads Google’s script only after the visitor presses Continue. Your server contacts Google when verifying the resulting token.
- Where:
https://www.google.com/recaptcha/api.js(the script, loaded by the visitor’s browser) andhttps://www.google.com/recaptcha/api/siteverify(the check, made by your server). - What is sent. Google’s script sends its own technical data from the browser. Your server sends the verification token and the visitor’s IP address to Google.
- Cookie. After a successful check ChatHearth sets a cookie called
chathearth_human(HTTP-only) that lasts at most 60 minutes and is used only to skip repeated checks. - Google Terms of Service and Google Privacy Policy.
Source code and build
The scripts of the settings page are written as small readable modules in assets/js/admin/, and the script of the chat widget as modules in assets/js/frontend/ and assets/js/shared/; all of them are included in this plugin. The files in assets/js/build/ (assets/js/build/index.js for the settings page and assets/js/build/widget.js for the chat widget) are generated from them with the @wordpress/scripts package. The styles in assets/css/admin.css and assets/css/widget.css are written by hand and are not generated.
To rebuild the scripts, open a terminal in the plugin folder and run:
npm installnpm run build
Credits
The icons on the settings page are original line drawings created for ChatHearth. They are released under the GPL-2.0-or-later licence, like the rest of the plugin.
Written by Joobi from the project's own listing. See the source page
2.0.0
ChatHearth 2, a complete rewrite of 1.4.9. What changed since 1.4.9:
Chat
* A new chat window: a launcher (icon or pill) on public pages opens a panel with your welcome message and suggestions, formatted answers, sources and product cards. It follows your appearance settings on any theme, works with the keyboard and screen readers, mirrors for right-to-left languages, fills the screen on phones and respects “reduce motion”.
* The conversation is kept in the visitor’s browser and removed after 24 hours without a new message. Answers are shown safely: nothing in an answer can add markup or run a script, and links are limited to web addresses.
* A temporary provider failure is retried once, and visitors only ever see a generic message. The 1.4.9 developer hooks work again, and a translation template (languages/chathearth.pot) ships with the plugin.
Website grounding
* The assistant answers only about your website and politely refuses other topics. Every message carries a short summary of your public pages and, with WooCommerce, your store and its categories.
* “This page” and “this product” work: the public content of the page the visitor is on is added to the message. Sources, and for a product a product card, appear under an answer that links to that page.
* Your site’s instructions in the AI Settings tab are added after the rules of the website and cannot widen the scope. Drafts, private and password-protected content is never used.
Knowledge Base
* Your chosen public content is turned into readable documents and indexed in the background, in small steps, so large sites never time out. The Knowledge Base tab shows the progress, and indexing waits on its own while OpenAI is not ready.
* Later changes update only what changed: publishing, editing, unpublishing, deleting, renamed categories, price and stock changes. Saving an item without a change costs nothing. Changing the passage size or the embedding model re-indexes in the background.
* Every question that passes the protection checks is matched against your indexed passages, and the best passages are given to the assistant. Answers list their sources. Comparison questions use twice as many passages, in English and Arabic, and developers can add words with the chathearth_comparison_words filter.
* Searching stays light as the site grows: about 6 MB of memory at 10,000 passages and no more beyond, and an optional object cache keeps the searched data. The built-in vector store suits about 10,000 passages (roughly 2,500 pages) and every search stops after 2 seconds; the chathearth_vector_store filter works for larger sites.
* The Index card works: counts of indexed, pending, excluded and failed items, the time of the last sync, a Sync now button with a progress bar, a list of items you can search, filter by type, status and Included, and switch on or off, and a Failed alert that shows the reason for each item. Test storage checks that the index storage is ready.
* Optional protected markdown copies of your content are kept in the uploads folder and removed when you turn the setting off. An index from ChatHearth 1.4.9 keeps working and is converted to the new format in the background, without new OpenAI requests.
Protection
* Per-visitor-network and site-wide rate limits; sustained abuse raises an alert by e-mail and in the admin area, and the chat can switch itself off with a one-click recovery link.
* Logged-in users are counted per account, with an optional larger allowance for each role (×1 to ×10). A list of blocked addresses and ranges (IPv4 and IPv6) refuses a visitor before anything else happens. An invisible bot trap refuses requests that fill in a hidden field. “Clear rate-limit counters” starts every count from zero, and the limit message can show {limit} and {window}.
* Behind a CDN or proxy such as Cloudflare, turn on “Use a trusted proxy” and list its addresses, so limits and blocking use the real visitor address.
* Optional Google reCAPTCHA v3 verification loads when the visitor selects Continue. A short-lived cookie lets verified visitors keep chatting on the same network.
Moderation
* Messages that contain a blocked word or phrase, or that OpenAI moderation flags, are refused with your reply before any answer is generated. Blocked phrases now match whole words only, in any language, so “ass” no longer blocks “class”. A 1.4.9 list that relied on matches inside words may block less.
* OpenAI moderation checks the new message and up to two earlier visitor messages, remembers results for 24 hours, and lets the message through when OpenAI is unavailable. “Moderation time limit” controls how long to wait.
Shop
* With WooCommerce, the products a visitor names, the product of the page they are on and the products found in your Knowledge Base appear as cards with price, stock and, for a variable product, a choice of option. Cards are styled by the eight product card settings.
* Add to cart works from the chat, for guests too, with “Added to cart.” and View cart and Checkout links. One visitor network can add 30 products in 10 minutes.
* Comparisons: when a visitor names two or more products and asks to compare them, the answer and the cards cover exactly those products, with their real price, stock, categories, attributes and short description.
* Product names are found through a cached index that is built in the background and kept current, so a shop of 50,000 products stays fast. Compatible with WooCommerce’s custom order tables and the cart and checkout blocks. Without WooCommerce nothing of this appears.
Settings
* A settings page under Settings, ChatHearth – AI Chatbot, with six tabs and a Settings link on the Plugins screen; a live preview of the chat window while you change colours, sizes and text, with a warning when text would be hard to read; unsaved changes are marked, and mistakes are explained with links to each field.
* The page shows whether the chat is live, off or not ready and a System status list with a report you can copy. Suggested privacy-policy text covers every way ChatHearth handles visitor data. The reCAPTCHA secret key is never shown after it is saved. Deleting the plugin removes all of its data, unless “Keep data on uninstall” is on.
Update from 1.4.9
* Updating from 1.4.9 is checked end to end: a populated 1.4.9 site is updated and compared before and after. Your settings, Knowledge Base entries and passages, an abuse alert and visitors’ saved chats are all kept, and nothing is embedded again. The unused Chroma and Pinecone settings are removed.
* A CAPTCHA pass earned in 1.4.9 keeps working until it expires, up to one hour after the update, and is never renewed. A pass earned after the update belongs to the visitor’s network.
* The chatHearth script data prints the 1.4.9 keys that the 2.0 widget does not read again, for themes and plugins that read them. How to go back to 1.4.9 is explained in the FAQ.
1.4.9
- Reset launcher and header button styles so themes such as WoodMart cannot restyle the chat widget.
- Fix Knowledge Base entries list on sites that use plain permalinks (
?rest_route=).
1.4.8
- Plugin Check (PCP) clean: hide the launcher until OpenAI is ready, and pass WordPress.org plugin checks.
1.4.7
- Hide the front-end chat icon until an OpenAI API key is configured under Connectors.
1.4.6
- The chatbot can answer questions about the page the visitor is currently viewing.
1.4.5
- Replace Google reCAPTCHA v2 with v3. A white, translucent, blurred overlay covers the chat until verification succeeds.
1.4.4
- Knowledge base storage is the WordPress database only. No Python, Chroma, Pinecone, or extra server setup.
1.4.3
- Clarify that Chroma is an HTTP server (data files on this host are written by that process). Clearer Test vector store errors. Helper script
bin/run-chroma.sh.
1.4.2
- Smooth expand and restore animation for the chat window.
1.4.1
- Shop-style product cards in chat (image, current and previous price, Add to cart).
- Header control to double the chat window, with a restore control when expanded.
- Horizontal, swipe/scrollable product cards when the panel is too narrow.
1.4.0
- Knowledge Base (RAG): markdown export of selected site content, admin include/exclude, incremental reindex.
- Vector stores: WordPress database, self-hosted Chroma, or Pinecone.
- Always-on website grounding and off-topic refusal, even when RAG is off.
- Product comparison in chat and add to WooCommerce cart from the widget.
1.3.0
- Renamed plugin to ChatHearth – AI Chatbot (slug
chathearth) with matching text domain, namespaces, options, REST routes, and asset handles.
1.2.0
- Renamed plugin to PalWP – AI Chatbot (slug
palwp-ai-chatbot) with consistent Option A prefixes. - Stopped reading Connectors API keys via
get_option(); readiness uses the WordPress AI Client registry. - Documented external services (OpenAI, Google reCAPTCHA) in the readme.
- Removed bundled translation files; translations are handled via translate.wordpress.org.
1.1.3
- Scroll chat to the latest message when opening the panel after a page reload.
1.1.2
- AI provider failures return a generic client message; details go to
debug.logonly whenWP_DEBUG_LOGis already enabled.
1.1.0
- Optional Google reCAPTCHA v2 checkbox on chat (enabled when site + secret keys are set); one solve unlocks chat for about an hour; green status in Protection settings.
- Fix: CAPTCHA no longer resets after every message.
1.0.9
- Global (site-wide) rate limits with admin escalation email, notice, and optional auto-disable.
1.0.8
- Markdown list rendering fixes; settings tabs under Settings ChatHearth – AI Chatbot; provider/model selectors.
1.0.0
- Initial release: site-wide widget, settings, OpenAI via Connectors, rate limits.
Follow this listing's changes (Atom feed)