# Install the Robylon Chatbot on a WordPress Site

Add the Robylon chatbot to your WordPress site with a code snippet plugin such as WPCode.

> Source: https://www.robylon.ai/docs/chatbot/install/wordpress
> Section: Chatbot

To add the Robylon chatbot to a WordPress site, copy the chatbot's snippet from Robylon and add it with a code snippet plugin. This guide uses the free WPCode plugin. You need admin access to WordPress.

## How do I copy the chatbot snippet from Robylon?

Go to **Settings → Channels → Chatbot**, click your chatbot, open the **Install** tab, choose **Web → Wordpress**, and copy the snippet. It already contains your Chatbot ID. See [Installation](https://www.robylon.ai/docs/chatbot/installation) for what the snippet does.

## How do I install the WPCode plugin?

If you already have a plugin for adding code to your site, skip to the [next section](#how-do-i-add-the-chatbot-to-my-wordpress-site).

<Steps>
  <Step title="Add a new plugin">
    In your WordPress admin, go to **Plugins → Add New Plugin**.

    <Frame>
      <img src="/assets/docs/wp-1.webp" alt="WordPress admin Plugins menu with Add New Plugin" width="1899" height="848" />
    </Frame>
  </Step>
  <Step title="Install WPCode">
    Search for **WPCode** and click **Install Now**.

    <Frame>
      <img src="/assets/docs/wp-2.webp" alt="WPCode plugin in the WordPress plugin search results" width="1892" height="829" />
    </Frame>
  </Step>
  <Step title="Activate it">
    Click **Activate**. WPCode then appears in **Installed Plugins** and adds a **Code Snippets** menu.

    <Frame>
      <img src="/assets/docs/wp-3.webp" alt="WPCode plugin with the Activate button" width="1475" height="840" />
    </Frame>
  </Step>
</Steps>

## How do I add the chatbot to my WordPress site?

Create a custom snippet with the Robylon code and set it to insert automatically.

<Steps>
  <Step title="Open Code Snippets">
    In your WordPress admin, click **Code Snippets**.

    <Frame>
      <img src="/assets/docs/wp-4.webp" alt="WordPress admin sidebar with the Code Snippets menu" width="1883" height="826" />
    </Frame>
  </Step>
  <Step title="Add a custom snippet">
    Click **Add New**, then **+ Add Custom Snippet**.

    <Frame>
      <img src="/assets/docs/wp-6.webp" alt="WPCode Add Snippet page with the Add Custom Snippet option" width="1881" height="799" />
    </Frame>
  </Step>
  <Step title="Choose the code type">
    Choose **HTML Snippet**, because the Robylon code includes its own `<script>` tag. The **JavaScript Snippet** type adds a second `<script>` tag around the code, which stops it working.
  </Step>
  <Step title="Paste the snippet and save">
    Give the snippet a title such as "Robylon chatbot", paste the Robylon code, and save.
  </Step>
  <Step title="Insert it automatically">
    Under **Insertion**, choose **Auto Insert** and a location in the site header, then make the snippet **Active**.

    <Frame>
      <img src="/assets/docs/wp-9.webp" alt="WPCode insertion settings with Auto Insert selected" width="1884" height="822" />
    </Frame>
  </Step>
  <Step title="Test">
    Open your site. The chatbot launcher appears in the corner of the page. Open it and send a test message.

    <Frame>
      <img src="/assets/docs/wp-10.webp" alt="WordPress site with the chatbot launcher in the bottom right corner" width="1885" height="816" />
    </Frame>
  </Step>
</Steps>

If the launcher does not appear, see [How do I know the chatbot is installed correctly?](https://www.robylon.ai/docs/chatbot/installation#how-do-i-know-the-chatbot-is-installed-correctly)
