Sphinx Agent logo Sphinx Agent
Guide 10 min read

AI Chatbot for Website: How to Add One in 5 Minutes

Adding an AI chatbot to your website is now a copy-paste job. Here is exactly how to do it — with one line of code — on WordPress, Shopify, Wix, or React, plus what it can do and how to start free.

A few years ago, putting a real AI chatbot on your website meant hiring a developer, wiring up an API, and babysitting a model. Today it is a five-minute, no-code task: you build an agent, train it on your own content, and paste a single line of code into your site. The chat bubble shows up in the corner and starts answering visitors 24/7.

This guide walks through the whole thing — what an AI chatbot for a website actually does, the exact steps to add one, platform-specific instructions for WordPress, Shopify, Wix, and React, and how to do it for free. I build Sphinx Agent, so I will use it for the examples, but the approach is the same for most modern no-code platforms.

What an AI Chatbot for a Website Actually Does

A modern AI chatbot is not the scripted "Press 1 for sales" bot of the past. It is trained on your business's own content and understands natural language. Once it is live on your site it can:

  • Answer FAQs instantly — hours, shipping, pricing, policies — pulled from your own pages.
  • Handle support — order status, returns, troubleshooting — without a human in the loop.
  • Capture and qualify leads — ask the right questions and collect contact details.
  • Book appointments — check availability and confirm times.
  • Talk, not just type — with platforms that support voice, the same agent can answer by browser voice or on a real phone number.

Because it runs around the clock, it catches the visitor at 2 a.m. who would otherwise bounce. That is the entire business case.

How to Add an AI Chatbot to Any Website (5 Steps)

  1. Create an agent. Sign up (free on Sphinx Agent), click New Agent, and give it a name and a role such as Support or Sales.
  2. Train it on your content. Paste your website URL or upload documents. The agent reads your pages and answers from them, in your brand voice.
  3. Pick a model and test. Choose an AI model (GPT-4o for accuracy, DeepSeek for cost-efficient high volume), then chat with it in the preview and refine the tone.
  4. Copy the one-line embed. The dashboard gives you a script tag that looks like the snippet below.
  5. Paste it into your site before the closing </body> tag. Save, reload, and the chat bubble appears on every page.

The embed is a single asynchronous script — here is the shape of it (your dashboard gives you the exact one with your agent ID):

<script src="https://widget.sphinxagent.ai/embed.js"
        data-agent-id="YOUR_AGENT_ID" defer></script>

That is the whole install. No package to manage, no build step, no API keys exposed in your front-end.

Platform-by-Platform Setup

WordPress

You do not need a special plugin from the chatbot vendor. Use a code-injection plugin such as WPCode or Insert Headers and Footers, and paste the embed script into the Footer box. Prefer editing theme files? Add the script to footer.php just before </body>. Because it loads site-wide, the widget shows on every post and page.

Shopify

In your Shopify admin go to Online Store → Themes → Edit code, open theme.liquid, and paste the embed script right before the closing </body> tag. Save. The chatbot now appears across your storefront, including product and checkout-adjacent pages, ready to answer sizing, shipping, and returns questions.

Wix, Squarespace, and Other Builders

Most site builders have a custom-code or "embed HTML / header & footer" area in settings. In Wix, use Settings → Custom Code → Add Custom Code, paste the script, and set it to load on all pages in the body. Squarespace uses Settings → Advanced → Code Injection → Footer. Same script, different menu.

React, Next.js, and Custom Sites

For a React or Next.js app, either drop the script into your root HTML template (index.html or the Next.js _document/root layout), or inject it in a top-level component with a useEffect that appends the script tag once on mount. Loading it in the layout keeps the widget present across client-side route changes.

Why the One-Line Embed Matters

The single-script approach is not just convenient — it is safer and faster:

  • No blocked rendering. The script is async/deferred, so it loads after your content and does not hurt your Core Web Vitals.
  • No secrets in the browser. Your agent ID is public and harmless; the model keys stay on the platform's servers.
  • One place to update. Change the agent's training or personality in the dashboard and every page updates instantly — no redeploy.
One line of code, live on every page, updatable without touching your site again. That is the bar a modern AI chatbot should clear.

Can You Add an AI Chatbot for Free?

Yes. Sphinx Agent's free tier is $0/month and includes 1 agent, 100 messages per month, the chat widget, a shareable link, browser voice, and a Telegram bot — no credit card required. It is enough to prove the concept on a small site or a landing page.

Plan Price Agents Messages/mo Highlights
Free$01100Widget, link, browser voice, Telegram
Starter$19/mo55,000Knowledge base URLs, email support
Pro$49/mo2525,000Phone number agent, advanced analytics
Business$99/mo5050,0005 phone numbers, white-label branding

Start on Free, embed it, and upgrade only when real traffic pushes you past 100 messages a month.

Common Mistakes to Avoid

  • Skipping training. A bot that hasn't read your content will guess. Always point it at your site or docs first.
  • Stacking multiple chat widgets. One chatbot per site — two competing bubbles confuse visitors and slow the page.
  • Placing the script in the <head> without defer. Keep it deferred and near </body> so it never blocks your content.
  • Forgetting a fallback. Give the agent a way to hand off or collect an email when it truly can't help.

Next Steps

An AI chatbot is the fastest win on a website: minutes to install, working 24/7, and free to try. If you are weighing tools, read our honest Chatbase alternative comparison or the full Sphinx Agent vs Chatbase vs Intercom vs Tidio breakdown. Want a walkthrough tuned for support specifically? See how to build an AI customer service chatbot.

Create your free agent at sphinxagent.ai and paste it onto your site today.

Frequently Asked Questions

How do I add an AI chatbot to my website?

Create an agent on a no-code platform like Sphinx Agent, train it on your website URL or documents, then copy the one-line embed script into your site's HTML just before the closing </body> tag. The widget appears in the corner of every page automatically. On platforms like WordPress, Shopify, or Wix you paste the same script into a header/footer code area. No coding is required, and setup takes about five minutes.

Can I add an AI chatbot to my website for free?

Yes. Sphinx Agent has a free tier ($0/month) that includes 1 agent, 100 messages per month, the chat widget, a shareable link, browser voice, and a Telegram bot. You can embed it on your website with no credit card. Paid plans start at $19/month when you need more agents or messages.

How do I add an AI chatbot to WordPress?

In WordPress, paste the chatbot's one-line embed script into your theme's footer using a plugin like WPCode or Insert Headers and Footers, or add it in your theme's footer.php before </body>. Because the script loads on every page, the chat widget appears site-wide. No separate plugin from the chatbot vendor is required.

Can an AI chatbot answer questions about my specific business?

Yes. Modern AI chatbots are trained on your own content — you point them at your website URL or upload documents, and the bot answers using that knowledge base. It can handle FAQs, pricing questions, order status, returns, booking, and lead capture in your brand's voice, 24/7, without a human agent.

Will an AI chatbot slow down my website?

No, if it loads asynchronously. A well-built embed script loads after your page content and runs in the background, so it does not block rendering or hurt your Core Web Vitals. Sphinx Agent's widget loads this way. Avoid adding multiple heavy chat scripts, and use one chatbot per site.

What is the difference between a chatbot and an AI agent?

A traditional chatbot follows scripted rules and decision trees. An AI agent uses a large language model to understand natural language, reason over your knowledge base, and take actions such as booking an appointment, qualifying a lead, or answering by voice or phone. Sphinx Agent is an AI agent platform, so the same tool that powers your website chat can also answer a phone number.

Terrell K. Flautt

Terrell K. Flautt

Founder of Sphinx Agent and SnapIT Software. Writes about AI agents, autonomous systems, and the business of artificial intelligence.

Share this article

Put an AI Chatbot on Your Site Free

One line of code. Trained on your content. Works 24/7. 100 messages/month free — no credit card.

Sign Up Free at sphinxagent.ai

Related Articles