> ## Documentation Index
> Fetch the complete documentation index at: https://wiredesk.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# WordPress

> Add the chat widget to a WordPress site with the Wiredesk plugin: paste your widget key, no theme edits.

The Wiredesk plugin puts your agent's [chat widget](https://wiredesk.ai/docs/widget/install.md) on a WordPress site. You paste the widget key once under **Settings → Wiredesk**, and every page gets the same one-line embed the install page shows:

```html theme={null}
<script src="https://wiredesk.ai/widget.js" data-widget="wk_..." async></script>
```

The plugin loads it in the footer, asynchronously, through WordPress's own script loader, so caching and optimisation plugins treat it like any other script. It needs WordPress 6.3 or later and PHP 7.4 or later.

> [!NOTE]
>
> The plugin is waiting for review in the WordPress.org plugin directory. Until it is listed, add the widget with a header and footer plugin or your theme, as in [Install the widget](https://wiredesk.ai/docs/widget/install.md).

## Set it up

**1. Install the plugin**

In WordPress, go to **Plugins → Add New Plugin**, search for **Wiredesk**, then click **Install Now** and **Activate**.

**2. Copy your widget key**

In Wiredesk, go to **Agents → your agent → Channels › Website chat › Install**. The key is the `wk_...` value in the snippet.

**3. Paste it into WordPress**

Go to **Settings → Wiredesk**, paste the key into **Widget key** and click **Save Changes**. The status line above the fields says **on** once the widget is loading on your site.

**4. Check a page**

Open any page of your site. The launcher appears in the bottom-right corner. If your site uses a page cache (WP Rocket, LiteSpeed Cache and the like), purge it once first.

## Settings

| Setting | What it does |
| - | - |
| **Widget key** | The `wk_...` key of the agent to show. A value that isn't shaped like a key is refused, and the saved key is kept. |
| **Show the widget** | Switches the widget off without forgetting the key. On by default. |
| **Hide on these pages** | Post or page IDs, separated by commas. The widget shows everywhere else. A page's ID is the number after `post=` in its edit link. |

The widget's look, greeting and behaviour are set in Wiredesk, under [customise the chat widget](https://wiredesk.ai/docs/widget/appearance.md), not in WordPress. A change there shows on your site straight away.

The widget key is public: it is in your page source. To stop it working on sites that aren't yours, set [allowed domains](https://wiredesk.ai/docs/widget/allowed-domains.md), and include your WordPress site's domain.

## For developers

The `wiredesk_show_widget` filter decides, page by page, whether the widget loads. It receives `true`, or `false` on a page in **Hide on these pages**, and the saved settings. It runs after the on/off switch and the key check, so it can hide the widget but cannot load it without a key.

```php theme={null}
// Keep the widget off WooCommerce checkout.
add_filter( 'wiredesk_show_widget', function ( $show ) {
	return $show && ! ( function_exists( 'is_checkout' ) && is_checkout() );
} );
```

Per-page overrides such as `window.wiredeskSettings` and the [JavaScript API](https://wiredesk.ai/docs/widget/javascript-api.md) work the same as on any other site. Print `window.wiredeskSettings` before the footer, for example from `wp_head`.

## What it stores and sends

The plugin stores one option, `wiredesk_settings`, holding the key, the switch and the list of IDs. Deleting the plugin from the **Plugins** screen removes it, on every site of a multisite network. Conversations live in Wiredesk and are not affected.

The plugin sends nothing from your WordPress database to Wiredesk. Visitors' browsers load `widget.js` from wiredesk.ai, and what a visitor types into the chat is sent to Wiredesk, as with any other install. See the [privacy policy](https://wiredesk.ai/privacy).

## It is not showing up

* Check that **Show the widget** is ticked and the page isn't in **Hide on these pages**.
* Purge your page cache, and any CDN cache in front of the site.
* If the widget has allowed domains, your WordPress site's domain must be on the list.

The rest is in [the chat widget is not showing up](https://wiredesk.ai/docs/troubleshooting/widget-not-showing.md).

## Related

* [Install the widget](https://wiredesk.ai/docs/widget/install.md)
* [Allowed domains](https://wiredesk.ai/docs/widget/allowed-domains.md)
* [Integrations](https://wiredesk.ai/docs/integrations/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.