Install on WordPress
This guide adds your agent to a WordPress or WooCommerce site in about ten minutes. It uses the free WPCode plugin and covers the one thing that most often goes wrong on WordPress: speed plugins that bundle or delay scripts.
Before you start
- Your agent is published, and your site’s exact address is in Deploy → Allowed origins, for example
https://example.com. Addhttps://www.as a separate line if your site uses it. - You have copied the snippet from Deploy. It looks like this, with your own agent id:
<script src="https://sitelet-widget.onrender.com/v1/loader.js" data-agent-id="YOUR-AGENT-ID" defer ></script> - You can sign in to WordPress as an administrator.
1. Paste the snippet in the footer
- In WordPress, install and activate WPCode (Plugins → Add New → search “WPCode”), if it is not there already.
- Open Code Snippets → Header & Footer (the page is titled “Global Header and Footer”).
- Paste the snippet in the Footer box, the last one on the page. Leave the Header and Body boxes as they were.
- Click Save Changes.
Use Footer, not Body. WPCode’s Body box prints the script just after the opening <body> tag, before your header and content. On a site with a page builder and a caching plugin this can leave the saved page without its header or footer. The Footer box prints it just before </body>, after the page is built, which is where the snippet belongs.
2. Tell your speed plugin to leave the widget alone
Speed plugins combine every script on the page into one file, or hold scripts back until the visitor scrolls. When the widget script is combined it loses its data-agent-id, does not know which agent to open, and no chat button appears. Exclude it once:
LiteSpeed Cache
- Open LiteSpeed Cache → Page Optimization and choose the Tuning tab (not “Tuning - CSS”, and not the Cache settings page, whose Excludes tab is for pages).
- Add
sitelet-widget.onrender.comon a new line at the end of each of these boxes, keeping what is already there:- JS Excludes
- JS Deferred / Delayed Excludes
- Guest Mode JS Excludes
- Click Save Changes.
Other plugins
- WP Rocket: File Optimization → Excluded JavaScript Files, and Delay JavaScript execution → Excluded JavaScript Files. Add
sitelet-widget.onrender.comto both. - Autoptimize: JavaScript Options → Exclude scripts from Autoptimize. Add
sitelet-widget.onrender.com. - SiteGround Optimizer, W3 Total Cache, Hummingbird: add the same address to the list of scripts excluded from combining, minifying and deferring.
- Cloudflare: if Rocket Loader is on, add
data-cfasync="false"to the snippet, next todefer, so Rocket Loader leaves it alone, or turn Rocket Loader off.
3. Clear the caches
Cached pages were saved before the snippet existed, so visitors keep seeing them until you clear them.
- LiteSpeed Cache: hover the LiteSpeed icon (a small diamond) in the black admin bar and choose Purge All, or open LiteSpeed Cache → Toolbox → Purge → Purge All.
- Elementor: Elementor → Tools → Regenerate CSS & Data.
- Other plugins: use their “Clear cache” or “Purge all” button, and purge Cloudflare if you use it.
4. Check it as a visitor
Administrators are often shown unoptimized pages, so a check while signed in to WordPress can pass while visitors see nothing.
- Open your site in a private or incognito window, on a computer and on a phone.
- The chat button appears in the corner in your agent’s colour. Open it and ask a question.
- Scroll the whole page: the header, menu and footer look as they did before.
WooCommerce shops
On a shop, the agent can answer from your live catalog, with prices, stock and product cards whose buttons lead into your shop. Do the steps above first, then these.
5. Check that your catalog is reachable
Sitelet reads the same public product list your shop pages use. Open this address in a private window, with your own domain:
https://your-shop.com/wp-json/wc/store/v1/products?per_page=1- You see text starting with
[{: the catalog is reachable. Carry on. - Only
[]: the catalog is reachable but lists no products. Check that your products are published and visible in the shop. - A security check, “Access denied” or an error page: a firewall or security plugin (Wordfence, Cloudflare Bot Fight Mode, your host’s protection) is blocking it. Allow the path
/wp-json/wc/storethere. - “No route was found”: WooCommerce is missing, inactive or very old. Update it.
6. Connect the store and publish
- In your agent, open Knowledge → Store and connect your shop’s main address (
your-shop.com, orhttps://example.com/shopwhen WordPress lives under a path). The full guide is Connect a WooCommerce shop. - Wait until the Store block shows the products as imported, then try a few product and price questions in Playground.
- Publish again, even if the agent is already live: visitors see the products only after this publish. After that, price and stock changes arrive by themselves, about every 24 hours or within seconds with change notifications.
Do not also upload your product list as files. A spreadsheet or document of products next to the connected store gives the agent two versions of every price, and the file never updates. Keep files for what the catalog does not hold: delivery areas and times, returns, branches and opening hours, payment methods, gift wrapping, how to use a product.
7. Check the shopping flow as a customer
- In a private window, ask the agent for a product you sell, for example “a gift under 200” in your shop’s currency. Prices and stock in the answer match the product pages.
- On a product card, choose Add to cart. Your shop opens in a new tab with the product in the cart. If the cart stays empty, your caching plugin is serving a saved copy of the product page: make sure it does not cache pages opened with
?add-to-cart=(LiteSpeed Cache and WP Rocket normally skip them unless their settings were changed), then purge. - Open the cart and checkout pages on a phone. The chat button sits above any bar your theme pins to the bottom of the screen, such as a mobile menu or a sticky “add to cart” strip, so your own buttons stay reachable.
Sitelet never sees your orders, carts, customers or payments, and needs no WooCommerce API key or admin account: the cart stays in your shop, in the shopper’s own browser.
Troubleshooting
- No chat button for visitors, but you see it when signed in: the speed plugin is still combining or delaying the script. Recheck step 2, then purge again.
- No chat button on phones only: many caching plugins keep a separate mobile copy of each page. Purge all caches, then test on the phone in a private tab.
- Header or footer disappeared after adding the snippet: remove it from the Body box, paste it in the Footer box, then purge the page cache and regenerate Elementor CSS.
- Old prices in answers: the store syncs about every 24 hours; choose Refresh now in the Store block, or set up change notifications. Remove any uploaded product files that repeat the catalog.
- “This assistant is unavailable” when opened: the address in the browser is missing from Allowed origins (check
www), or the agent is not published.
The general install steps are in Your first website assistant.