Guide

How to add live chat to WordPress

Adding live chat to WordPress does not require a hosted plugin that keeps your conversations in someone else's cloud. With a self-hosted server like DChat you run the chat backend yourself and add it to WordPress with a single snippet, the same way you would on any other site.

Step 1. Install the chat server

The chat backend runs separately from WordPress. Install the DChat server on your own infrastructure, Windows with IIS, Linux with Nginx, or Docker, and run the included SQL scripts against your database. You can rehearse the whole thing on the free localhost evaluation first.

Step 2. Create your widget

Sign in to the dashboard, set the widget colors and greeting to match your WordPress theme, choose the pre-chat fields you want, and copy the generated script snippet. If you want an AI chatbot to answer first, load a few knowledge-base articles and enable it here.

Step 3. Add the snippet to WordPress

Paste the snippet so it loads on every page, just before the closing body tag. The simplest way is a header-and-footer plugin: add the snippet to the footer section. If you maintain your own theme, add it to footer.php before the closing body tag, or enqueue it from your theme functions. No dedicated chat plugin is required.

Step 4. Test on your site

Open your WordPress site, click the chat launcher, and start a conversation as a visitor. Answer it from the dashboard or the Windows desktop console, then confirm the transcript and satisfaction rating land in your own database. Once that works, you are live.

Works with any CMS

One snippet, not a plugin dependency

Because the widget is a single script tag, the same setup works on WordPress, a static site, or a custom app. The server and the data stay yours, and there is no chat plugin to keep updated or to trust with your conversations.

Adding DChat to WordPress

There is no DChat plugin to install, and you do not need one: WordPress just needs to output one script tag before the closing body tag.

  1. 1. Get your snippet

    Open Widget Builder in the DChat dashboard and copy the generated embed code. It already points at your own server.

  2. 2. Paste it into WordPress

    The lowest-risk route is a header-and-footer code plugin: paste the snippet into the footer or body section and save. It survives theme updates and needs no file editing.

    If you prefer editing files, add it to footer.php in a child theme, just before wp_footer(). Editing the parent theme directly means losing the change on the next update.

  3. 3. Route by page if you want to

    Add data-department so product and checkout pages reach sales while support articles reach support. Add data-track-visitors="false" on checkout or account pages you would rather keep out of visitor monitoring.

  4. 4. Verify on the front end

    Load your site logged out (or in a private window - caching plugins often bypass cache for logged-in admins) and confirm the launcher appears. Then run one real conversation from the widget to an agent.

Questions we get asked

Do I need a WordPress plugin for DChat?

No. DChat is a script tag, so any method of adding code before the closing body tag works - a header-and-footer snippet plugin, your child theme's footer.php, or your theme's built-in custom-code box. No DChat plugin is required or published.

Where do I paste the code in WordPress?

The simplest route is a header/footer code plugin: paste the snippet into the body or footer section. Alternatively add it to footer.php in a child theme, just before wp_footer() or the closing body tag. Use a child theme so a theme update does not overwrite it.

Will a caching plugin break it?

No. The snippet is static markup and the widget loads asynchronously, so page caches and CDNs serve it fine. If you use a plugin that combines or defers scripts, exclude zchat.iife.js from combination to be safe.

Will it clash with my theme's CSS?

No. The widget renders inside a Shadow DOM, so your theme's styles cannot leak in and the widget's styles cannot leak out - a common problem with chat widgets on heavily-styled themes.

Does WooCommerce work with this?

Yes, and the department attribute is useful there: put a support department on your account pages and a sales department on product and checkout pages, so conversations arrive in the right queue.

Self-hosted customer support software

Deploy live chat on your own terms, not on someone else's pricing model.

DChat gives you the installable server, web dashboard, website widget, and desktop agent tools in one self-hosted product, with live chat free to run, and an AI agent that answers, acts with the approvals you set and hands off to your team when you want one. Run it on infrastructure you trust, on the model you choose.

Deployment

Install on Windows or Linux, behind IIS or Nginx, in a VM, or in Docker if that fits your stack.

Commercial model

Live chat is free with unlimited agents. Premium, with the AI agent, is billed per agent per month, never per conversation.

AI Flexibility

Run the AI agent on a local Ollama model, or connect OpenAI and Anthropic with your own provider accounts.