Skip to content
ConvoRail - Conversational AI for Businesses
Setup Guides

How to Add a Chatbot to Your WordPress Website

Adding a chatbot to WordPress usually means pasting one script tag in the right place. Here are the safe ways to do it, what to avoid and how to check that the widget appears on every page.

Sakshi Sidana
Sakshi Sidana
Founder & CEO
November 7, 2026 7 min read
How to Add a Chatbot to Your WordPress Website

WordPress runs a very large share of business websites, and adding a chatbot to one is usually a small job. ConvoRail installs with a single script tag, the same pattern as an analytics snippet, so adding a chatbot to WordPress comes down to putting that line on every page in a safe way. This guide covers three methods, the mistakes to avoid and how to test the result. It is general guidance: WordPress themes, plugins and hosting vary, so adapt the steps to your setup.

What Do You Need Before You Start?

  • Administrator access to your WordPress dashboard.
  • Your chatbot's script tag. In ConvoRail, copy it from your account settings. It includes your account's API key, so copy it exactly as shown.
  • A backup. Back up your site, or at least know how to restore it, before changing code.
  • A starter set of answers. The widget is only useful once it has knowledge. See how to set up ConvoRail step by step.

Which Is the Best Way to Add a Script to WordPress?

For most business owners, the best way is a built-in or plugin-provided "header and footer scripts" field. It survives theme updates and needs no code editing. A developer may prefer to load the script from a child theme or a small plugin. Avoid editing a parent theme's files directly, because a theme update can erase your change.

MethodBest forWatch out for
Theme's custom code or header/footer fieldThemes that include a scripts settingNot every theme has one
A header and footer scripts pluginMost site owners without a developerChoose a maintained plugin, and check reviews and recent updates
Child theme or small custom pluginDevelopers who want full controlRequires code, and mistakes can break the site

Method 1: Use Your Theme's Scripts Field

  1. 1Open your theme's settings or customiser and look for "custom code", "header scripts" or "footer scripts".
  2. 2Paste the ConvoRail script tag into the footer field, or the header field if your theme offers only that.
  3. 3Save, then clear any caching (see below).
  4. 4Open your site in a private window and check that the chat launcher appears.

If your theme has no scripts field, a plugin that adds header and footer scripts is the usual route. Search the plugin directory for one that is actively maintained, has a good number of recent updates and clear reviews. We do not endorse a specific plugin, and you should verify any plugin in the official directory before installing it.

  1. 1In the WordPress dashboard, go to Plugins and add your chosen plugin.
  2. 2Open the plugin's settings and find the footer scripts box.
  3. 3Paste the ConvoRail script tag exactly as copied and save.
  4. 4Clear caches and test in a private window.

Method 3: Load It Through a Child Theme or Small Plugin

Developers can enqueue the script through WordPress's script functions in a child theme or a small custom plugin. The widget needs the data attributes from your ConvoRail tag, such as the API key, so check how your approach preserves them. If you are not sure, use Method 1 or 2. A broken edit can take a site down, so test on a staging copy first.

What About WordPress.com and Managed Hosts?

Rules differ. Some WordPress.com plans and some managed hosts restrict custom scripts or plugins. If you cannot find a scripts field or cannot install plugins, check your plan's documentation or ask your host. We are not certain which plans allow it, so verify before you assume it will work.

Why Does the Widget Not Appear After Installing?

  • Caching. Clear your caching plugin, your host's cache and any CDN cache, then reload in a private window.
  • Script optimisation plugins. Plugins that combine, delay or remove scripts can block or alter the widget. Exclude the ConvoRail script from those features if needed.
  • A modified tag. Do not edit the tag. Missing attributes, such as the API key, stop it from loading.
  • Pasted into the wrong field. Make sure it is in a scripts or code field and not a text or visual-editor block that strips code.
  • Page builders. Some builders have their own script areas that apply only to certain pages. Use a site-wide option.

How Do You Test It Properly?

  1. 1Open the homepage, a blog post, a product or service page and the contact page in a private window.
  2. 2Check that the launcher appears on desktop and on a phone.
  3. 3Ask a question you wrote an answer for, and one you did not, to confirm the bot declines to guess.
  4. 4Request a person and check that a teammate can reply from the inbox.
  5. 5Test your site speed before and after, as covered in does a chat widget slow your website.

Use the pre-launch checklist for a fuller set of checks.

What Should You Do After It Is Live?

Tell your team the chatbot is live and who watches the inbox. Review the unanswered-question list each week for the first month and add answers for repeats. If you run an online shop on WordPress, also see what an online store chatbot should answer. If your theme changes later, re-test, because a new theme can drop custom code.

What Does a 15-Minute Install Checklist Look Like?

  1. 1Back up the site, or confirm your host keeps recent backups.
  2. 2Copy the script tag from your ConvoRail account settings.
  3. 3Paste it into the footer scripts field, using your theme or a maintained plugin.
  4. 4Save, then clear every cache layer: caching plugin, host cache and CDN.
  5. 5Open the homepage, one blog post and the contact page in a private window.
  6. 6Check mobile, ask one known question, one unknown question and request a person.
  7. 7Note where the tag lives, so you can find it after a theme change.

How Do You Troubleshoot Quickly?

SymptomLikely causeWhat to try
Widget missing on every pageTag not saved, or cache not clearedRe-check the field, clear all caches
Widget missing on some pagesPage builder or theme template excludes the footerUse a site-wide option or check the template
Widget appears but cannot connectTag edited, or API key attribute missingCopy the original tag again
Widget broke after an updateTheme change removed custom codeRe-add the tag and note its location

Pro Tip: If you use a security plugin or firewall, check its logs when something fails to load. Settings that block unknown scripts can interfere with any third-party widget.

Conclusion

To add a chatbot to WordPress, paste the ConvoRail script tag into a site-wide footer or header scripts field, using your theme's setting or a maintained plugin, and avoid editing parent theme files. Clear caches, test on several pages and on a phone, and check that the bot declines to guess and hands off to a person.

Key takeaways

  • ConvoRail installs with one script tag, so WordPress setup is about placing it site-wide safely.
  • Use a theme scripts field or a maintained header and footer plugin; avoid editing parent theme files.
  • Do not alter the tag; the API key attribute must stay intact.
  • Clear caches and exclude the script from optimisation plugins if the widget does not appear.
  • Test on several pages, on mobile, and test both unknown questions and a human handoff.

Quick Summary

Adding a chatbot to WordPress takes one script tag placed site-wide. Paste the ConvoRail tag into your theme's footer scripts field or a maintained header and footer scripts plugin, avoid editing a parent theme's files, then clear caches and test on several pages, on mobile, with an unknown question and a human handoff. Plans, themes and hosts vary, so verify what your WordPress setup allows before you start.

Want to see grounded answers on your own site?

Start free, add your Q&A pairs and paste one script tag. No credit card required.

Start free
TagsWordPress chatbotadd chatbot to WordPressWordPress script tagheader and footer scriptswebsite chatbot setup

Share this article

Sakshi Sidana
Sakshi Sidana

Founder & CEO

Writes about grounded AI chatbots for websites: how they work, how to measure them and what to check before you buy.

Topics

AI ReliabilityData & BenchmarksSetup GuidesComparisonsBuying GuidesAI TrendsProduct GuidesCustomer SupportIndustry GuidesAI Search

Get new posts by email

Guides on AI chatbots for websites, straight to your inbox.

FAQ

Frequently asked questions

About: How to Add a Chatbot to Your WordPress Website

How do I add a chatbot to a WordPress site?

Copy your chatbot's script tag and paste it into a site-wide footer or header scripts field, using your theme's setting or a header and footer scripts plugin. Then clear caches and test.

Do I need a plugin to add ConvoRail to WordPress?

Not necessarily. If your theme has a scripts field you can use it. Otherwise a maintained header and footer scripts plugin is the usual route. Verify any plugin in the official directory first.

Why is my chatbot not showing on WordPress?

Common causes are caching, a script optimisation plugin, an edited script tag, pasting into a field that strips code, or a page-builder script area that applies to some pages only.

Is it safe to edit my theme files to add the script?

It is risky. A theme update can erase changes to a parent theme, and a mistake can break the site. Use a scripts field, a plugin or a child theme, and back up first.

Can I add a chatbot to WordPress.com?

It depends on your plan, because some plans restrict custom scripts and plugins. Check your plan's documentation or ask support before you assume it will work.

What is ConvoRail?

ConvoRail is an AI chatbot platform for websites. It answers visitor questions using only the knowledge you give it, such as your Q&A pairs and website content, and hands the conversation to your team when it isn't sure.

How does ConvoRail avoid wrong or made-up answers?

It only answers when your knowledge base has a close match. If nothing matches, it says it doesn't have confirmed information, offers a contact form and flags your team instead of guessing.

Questions?

Want to talk about this?

Tell us about your site and what your customers ask. A real person replies.

By sending this you agree that we may contact you about your request. We never share your details.

See a chatbot that says it doesn't know.

Try the live demo, or start with your own Q&A pairs, free with no credit card.