Install the WordPress plugin
Add the chat widget to a WordPress site, send WhatsApp order updates from WooCommerce and add a "Chat on WhatsApp" button, all from one plugin.
On this page
The WordPress plugin connects your WordPress site to Chatilo. It does three things, and you can use any of them on their own:
- Shows your Chatilo chat widget on the site.
- Sends WhatsApp order updates from WooCommerce when an order is placed, completed, cancelled or refunded.
- Adds a "Chat on WhatsApp" button anywhere with a shortcode.
The plugin's menus and labels use the name Chatilo, whatever name your installation carries.
There are two ways to send WooCommerce order messages. This plugin sends them from WordPress, with a tick box at checkout and four order events. The other way uses webhooks and needs no plugin; see Connect a WooCommerce store. Use one of the two, not both, or customers get each message twice.
Before you start
- You need admin access to your WordPress site (WordPress 5.8 or later, PHP 7.4 or later).
- You need the plugin file
chatilo.zip. Ask the person who runs your Chatilo installation for it. - For order updates: you must be a workspace owner or admin to create an API key, and your plan must include API access (shown on plans as "API, Zapier and CRM sync").
- For order updates: you need a connected WhatsApp number and at least one approved template. WhatsApp only lets a business message a customer first with a template that Meta has approved. See Create a template.
- For the chat widget: create a widget first. See Create a chat widget. The widget needs no API key.
Step 1: Install the plugin
- In WordPress, go to Plugins → Add New Plugin and click Upload Plugin.
- Choose
chatilo.zipand click Install Now. - Click Activate Plugin.
- Go to Settings → Chatilo.
Step 2: Create an API key
Skip this step if you only want the chat widget or the button.
- In Chatilo, in the sidebar under Automate, click API and webhooks.
- In the API keys card, click New key.
- In Key name, type
WordPress. Under Access, keep Read and write selected. - Click Create key and copy the key from the green box straight away. It is not shown again.
Step 3: Connect the plugin
- In WordPress, on Settings → Chatilo, enter the address where you open Chatilo in Chatilo address, starting with
https://, with nothing after the domain. - Paste the key into API key.
- Click Save settings.
- Click Test connection. A green message shows your workspace name.
The page never shows the key again. It only shows the last four characters. To replace the key, paste a new one and save.
Show the chat widget
- In Chatilo, in the sidebar under Grow, click Chat widget and open your widget.
- In the Add it to your website card, click Copy.
- In WordPress, paste the copied line into Widget key. The plugin picks the key out of it.
- Tick Add the chat widget to every page of this site.
- Click Save settings and open your site. The chat button appears in the corner.
Two options control where it appears:
| Option | What it does |
|---|---|
| Hide for administrators | Logged-in WordPress administrators do not see the widget. Visitors still do. |
| Hide on these pages | Page or post IDs, separated by commas. The widget is left off those pages. |
Do not also paste the widget code into your theme, or the site loads it twice.
Send WooCommerce order updates
This part of the page appears only when WooCommerce is active.
- Tick Send WhatsApp messages when an order changes status.
- In Customer consent, choose how customers agree to messages. The choices are explained below.
- Change Tick box text if you want. Left empty, it reads "Send me order updates on WhatsApp".
- In Contact tag, type the tag each customer gets in your contacts, for example
WooCommerce customer. - In the What to send table, for each event you want: tick Send, and type the name of an approved template in Template name. Approved templates are suggested as you type once the connection works.
- In Body values, write one line for each numbered variable in the template body, in order. See Template variables and samples.
- Click Save settings.
The choices under Customer consent:
| Choice | What the customer sees |
|---|---|
| Optional tick box at checkout | A box they may tick. Only customers who tick it get messages. |
| Tick box the customer must tick | They cannot place the order without ticking it. |
| No tick box | A short notice instead. Every customer gets messages. Check what the law in your country asks for first. |
The four events:
| Event | When it is sent |
|---|---|
| New order | When the order's status becomes Processing or On hold. |
| Order completed | When the status becomes Completed. |
| Order cancelled | When the status becomes Cancelled. |
| Order refunded | When the status becomes Refunded (a full refund). |
Values can be fixed text or these fields: {{first_name}}, {{last_name}}, {{customer_name}}, {{order_number}}, {{total}}, {{status}}, {{order_date}}, {{payment_method}}, {{items}}, {{order_url}}, {{store_name}}.
For example, for a template that reads "Hi {{1}}, we have your order {{2}} for {{3}}.", write these three lines in Body values:
{{first_name}}
{{order_number}}
{{total}}
Language is only needed when the template exists in more than one language. Header value is the header's variable, or a public link to the image, video or document if the template has a media header.
Add a Chat on WhatsApp button
- On Settings → Chatilo, enter Your WhatsApp number with the country code and save.
- Edit a page or post and add a Shortcode block with:
[chatilo_button text="Hi, I have a question" label="Chat on WhatsApp"]
The button opens WhatsApp with your number and the text already typed in. To use a different number on one button, add number="+919876543210". The button works without an API key.
What happens next
- Each order is messaged once per event. The message is sent in the background, so the checkout is never held up, even if Chatilo cannot be reached.
- Every message, sent or failed, is written as a note on the order in WooCommerce, with the reason when it failed.
- The customer is added to your contacts with the tag you chose, and the message appears in a conversation in the inbox. See Tags.
- Deleting the plugin from WordPress removes its settings and the saved key. Order notes stay.
Common problems
Test connection says "Send your API key as: Authorization: Bearer <key>."
The key is wrong or was deleted in Chatilo. Create a new key and paste it again. Also check that Chatilo address has nothing after the domain.
"Connected, but this API key is read-only"
The key was created with Read only access. Create a new key with Read and write and paste it in.
"API access isn’t part of this workspace’s plan."
Your plan does not include API access. The chat widget and the button still work; order updates need a plan with API access.
No message was sent for an order
Open the order in WooCommerce and read the order notes. If there is no note from the plugin, the customer did not tick the box at checkout, the event is not ticked in What to send, or it has no template name. Orders you add by hand in WordPress have no consent recorded and are not messaged.
Order note: "No approved template with that name and language on this number."
The template name is misspelt, the template is not approved yet, or it belongs to another WhatsApp number. Check the name on the Templates page, fill in Language if the template exists in several, and pick the right number in Send from.
Order note: "the order has no usable billing phone number"
The customer left the phone field empty, or the number is too short. Make the phone field required at checkout. A number typed without a country code gets the calling code of the billing country.
Order note: "This contact has opted out of messages."
The customer replied STOP earlier. They are not messaged until they opt back in. See Opt-outs.
The widget does not appear
Check that Add the chat widget to every page of this site is ticked, that you are not an administrator with Hide for administrators on, and that the widget is active in Chatilo. If you limited the widget to certain websites, add this site's domain. See Add the widget to your website. Clear any caching plugin after changing the settings.
For WhatsApp's own errors see Messages not sending.
Pages, forms and phone verification
Version 1.1 of the plugin adds three shortcodes:
[chatilo_page slug="your-link-name"]embeds a page you built under Pages and forms: a form, a store, tickets, an invitation, appointments, a poll or bill payments. Addbutton="Book now"to show a button that opens the page instead, andheight="1100"to change the height.[chatilo_pages kind="form"]lists your published pages as links. Leavekindout for all of them.[chatilo_verify_phone template="login_code"]shows a box that sends a one-time code on WhatsApp and checks it. Usechannel="sms"for SMS. The verified number is saved on the logged-in user. For your own code, thechatilo_phone_verifiedaction runs with the number and the user id.
These need the API key saved in the plugin settings. See Put a page on your own website and API: pages, forms and one-time codes.