A step-by-step guide to adding an AI agent to a WordPress site that answers from your own content and captures leads.
Picture a 60-person company that makes industrial pumps. Its marketing site runs on WordPress, like a lot of company sites. A procurement manager in another time zone lands on a product page at 8pm. They want to know if a model handles a certain flow rate, whether the spec sheet is current, and who covers their region. Nobody is there to answer. They close the tab.
That's the job an AI chatbot on WordPress should do well: answer from your own pages and documents, then capture the lead so sales can follow up in the morning. I build AI chat agents for a living, so I'm not neutral here. But I'll show you exactly how the setup works, including the parts that take some care.
Why WordPress sites are a natural fit
WordPress is everywhere. According to W3Techs, it runs about 40% of all websites and 58.5% of sites whose content management system is known, as of October 14, 2026.
Most of those sites already hold the answers visitors want. Product pages, service descriptions, case studies, FAQs, downloadable spec sheets. The problem is that visitors don't read them. They want to ask a question and get a straight answer. A chat agent that reads your content can give them one.
Adding the chat itself is also easy on WordPress. The free WPCode plugin, which reports more than 3 million active installations, lets you add a script to every page without touching theme files.
A scenario: the pump manufacturer
Back to our hypothetical pump company. Their site has around 80 product and service pages, plus a folder of PDF spec sheets and a warranty policy. Their sales team gets most of its leads through a contact form that asks for a lot and gets filled in rarely.
What they want is simple. The chat should answer product questions from their own content, link to the right page, and ask for a name and work email before handing over to a person. It shouldn't make up a flow rate.
How we handle it: the setup, step by step
Here's how that setup works in AtomicX. Every step below comes from our help articles, and I've linked them so you can follow along.
1. Create a knowledge base
Go to AI → Knowledge bases and click Create knowledge base. Give it a Name and click Create. A new knowledge base is empty until you add content. (Guide)
2. Add your website and documents
On the knowledge base card, click Manage Content. On the Websites tab, click Add Website and enter your Website URL. A Maximum Depth of 1 level (current page only) scans just that page, so pick a higher level to follow links across the site. Available depths depend on your plan.
Set a Rescan frequency. The default is Manual only, so if your pages change often, choose Daily, Weekly or Monthly.
Then use the Documents tab to upload spec sheets and policies. It accepts TXT, Markdown, PDF, DOCX and HTML, up to 10 MB per file and 20 files per upload. Tick Available for download if you want visitors to see a download link under relevant answers. (Guide)
3. Create and publish an AI agent
Go to AI → AI agents and click Create agent. Write the Agent Instructions (System Prompt): who the agent works for, what it should and shouldn't answer, and when to ask for contact details. A lower Temperature gives more factual answers. New agents start as Draft, so click Publish when you're happy. (Guide)
4. Build the workflow, including lead capture
Go to Chat → Workflows. Add an AI Chat node, and under AI Configuration choose your AI Agent and your Knowledge Base. Don't skip the second one. If you leave Knowledge Base empty, the AI answers without your content.
For lead capture, the workflow has input nodes: Name Input, Email Input (which checks the format), Phone Input and Form Group for several fields at once. A Handoff node passes the conversation to your team, and team members can reply from Live monitor. With Enable exit detection on, the AI can move the visitor to those connected nodes when the conversation calls for it. (Node types)
5. Configure the widget
Go to Chat → Configurations. Under Basic Information, set the chat title and Welcome Message. Under Workflow, pick the workflow you just built. Under Appearance, match your brand colours and logo. (Guide)
Two settings under Additional Settings matter most for a content-heavy site. Show Page Links in Answers shows up to three relevant pages from your knowledge base as cards under an answer. Use Page Content for AI Answers gives the AI a snapshot of the page the visitor is reading, so they can ask "what does this mean?" without pasting anything. It's off by default. (Guide)
6. Copy the snippet
Go to Insights › Widget generator. Select your configuration, set the display mode, button position and theme, and choose Auto-Initialize as the integration method. Under Generated Code, click Copy. (Guide)
7. Add it to WordPress
This is the short part. Our WordPress install guide covers it in full:
- Go to Plugins › Add New Plugin, search for WPCode, then install and activate it.
- Go to Code Snippets › Header & Footer.
- Paste the snippet into the Footer box and click Save Changes.
- Clear any cache plugin, host cache or CDN cache.
8. Test it like a visitor
Open your site in a private window and look for the chat button. Ask a real question, the kind your sales team hears every week. Then check that the conversation shows up under Conversations in AtomicX. Test multi-page questions and check facts and page links separately.
The limits, honestly
None of this is magic, and a few things trip people up.
- Your content sets the ceiling. The agent answers from what you give it. If your spec sheet is out of date, the answer will be too. Our own docs say relevance ordering helps the AI choose sources but doesn't guarantee correct answers.
- Scans can be blocked. Security plugins and bot checks sometimes stop the scanner. Your host can allow the bot AtomicXChatBot and the server IP shown on the website card.
- Old pages linger until confirmed gone. A page leaves the knowledge base only when a scan gets a 404 or 410 for it. Timeouts keep the last version.
- The page snapshot has edges. It reads up to 12,000 characters of page text. It doesn't read images, PDFs or embedded frames. Personal information in ordinary page text isn't removed automatically, so your developer should mark private sections with data-atomicx-private.
- WordPress quirks. Don't paste the snippet into your theme's footer.php, because theme updates overwrite it. Exclude the AtomicX script from plugins that delay or combine JavaScript. A Custom HTML block only loads on one page. On WordPress.com, you need a paid plan that lets you add code, as WordPress.com's own guide explains.
If you run WooCommerce on the same site, there's a separate, read-only WooCommerce integration for product and order questions. It needs its own setup, including a read-only REST API key, so treat it as a second project.
The bigger pattern
Most company websites already contain the answers. They're just spread across 80 pages and a folder of PDFs. A chat agent doesn't replace that content. It makes it reachable at the moment someone has a question, and it hands the good conversations to a person.
If you want to try it, start small. Pick your ten most-asked questions, make sure the answers live on your site, and test the agent against those before you go live. Want to see it running on a WordPress site? Book a 20-minute demo, or read the WordPress install guide first.