How to add Cypher LM to a WordPress site
Quick answer
To add the widget to WordPress:
- In Cypher LM, open Agents › Deploy › Website widget and add your WordPress domain to Website addresses.
- Copy the code under Add it to your site.
- In WordPress, paste it into a header and footer code plugin's footer box, or your theme's custom code area.
- Save, clear your site cache and test the widget on your live site.
Cypher LM does not need a WordPress plugin of its own. The website widget is one line of code, and WordPress gives you several safe places to paste it so that it loads on every page. This article shows the two most reliable methods and how to stop caching and optimisation plugins from getting in the way.
Before you start
- In Cypher LM, open Agents › Deploy › Website widget and choose the agent you want on your site.
- Under Where will the widget appear?, add your WordPress site's domain to Website addresses, for example
example.com. Subdomains are included. - Set the Position and colour under Look.
- Under Add it to your site, copy the code. It is a single
<script>line that contains your agent ID.
You need a WordPress account with the Administrator role to add code to your site.
Method 1: a header and footer code plugin (recommended)
Most WordPress sites can use a free plugin that adds code to the header or footer of every page. This works with classic themes, block themes and page builders, and your code survives theme updates.
- In your WordPress admin, go to Plugins › Add New and search for a header and footer code plugin. Install and activate one that is well reviewed and actively maintained.
- Open the plugin's settings page. It is usually under Settings or has its own menu item.
- Paste the Cypher LM code into the Footer (sometimes called Body end) box. Avoid the header box, so the widget loads after your page content.
- Save your changes.
Method 2: your theme's custom code area
Some themes include their own place for footer scripts, often under Appearance › Customize or in the theme's options panel. If yours does, paste the code there and save. How this works depends on the type of theme:
- Classic themes: if your theme has no footer code setting, a developer can add the line just before
</body>infooter.php. Do this in a child theme, otherwise the next theme update removes it. - Block themes: the Site Editor does not have a footer script box, and a Custom HTML block placed in a template may not load on every page. Use Method 1 instead.
- Page builders: many builders have a custom code or integrations setting for site-wide footer code. Use that rather than adding an HTML widget to a single page.
Clear your cache and test
Caching and optimisation plugins often combine, delay or move scripts to speed up your site. That can stop the widget from appearing until a visitor scrolls or clicks, or hide it until the cache is cleared.
- After saving the code, clear your site cache in your caching plugin, and in your hosting dashboard if your host has its own cache.
- If the widget still does not appear, open your optimisation plugin's JavaScript settings and exclude
widget.jsfrom delaying, deferring or combining. - Open your site in a private browser window, wait for the page to load and check the corner you chose for the widget.
- Tap the widget, allow the microphone and make a short test call. The call appears in Calls in your Cypher LM dashboard.
Remove or change the widget
To change the widget's colour or position, edit it in Cypher LM; you do not need to touch WordPress. To remove the widget from your site, delete the line from the plugin or theme setting and clear your cache. To move the widget to another agent, copy that agent's code and replace the old line.