Guides

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

  1. Your agent is published, and your site’s exact address is in Deploy → Allowed origins, for example https://example.com. Add https://www. as a separate line if your site uses it.
  2. 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>
  3. You can sign in to WordPress as an administrator.

1. Paste the snippet in the footer

  1. In WordPress, install and activate WPCode (Plugins → Add New → search “WPCode”), if it is not there already.
  2. Open Code Snippets → Header & Footer (the page is titled “Global Header and Footer”).
  3. Paste the snippet in the Footer box, the last one on the page. Leave the Header and Body boxes as they were.
  4. 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

  1. 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).
  2. Add sitelet-widget.onrender.com on 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
  3. Click Save Changes.

Other plugins

3. Clear the caches

Cached pages were saved before the snippet existed, so visitors keep seeing them until you clear them.

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.

  1. Open your site in a private or incognito window, on a computer and on a phone.
  2. The chat button appears in the corner in your agent’s colour. Open it and ask a question.
  3. 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

6. Connect the store and publish

  1. In your agent, open Knowledge → Store and connect your shop’s main address (your-shop.com, or https://example.com/shop when WordPress lives under a path). The full guide is Connect a WooCommerce shop.
  2. Wait until the Store block shows the products as imported, then try a few product and price questions in Playground.
  3. 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

  1. 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.
  2. 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.
  3. 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

The general install steps are in Your first website assistant.