---
title: "Install the ServiceTitan Web Scheduler 2.0 Button on WordPress"
slug: "install-web-scheduler-2-0-button-wordpress"
updated: 2026-04-06T21:08:49Z
published: 2026-04-06T21:08:49Z
canonical: "help.servicetitan.com/install-web-scheduler-2-0-button-wordpress"
---

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

# Install onclick attribute and button element for ServiceTitan Web Scheduler 2.0 into WordPress: recommended workflow

### Things to know

- The main scheduler script should be installed at the end of the website <body> first prior to installing the button code.
- For more information on installing ServiceTitan's Web Scheduler 2.0, see [Set Web Scheduler for Office Employees](/v1/docs/set-web-scheduler-for-office-employees)
- The ServiceTitan Web Scheduler 2.0 requires a button element and an onclick attribute installed in the website code in order to trigger the scheduler widget popup. However, the onclick attribute code may not work with the preset button elements in certain website editors (such as WordPress). Instead of a preset button element, use a custom HTML code block to install the button and attribute code.
- Follow the [Retrieve button HTML code](/v1/docs/install-web-scheduler-2-0-button-wordpress#retrieve-button-html-code) workflow first to create the button HTML (you can skip this section if you already have a button HTML code). Then follow the [Use a custom HTML code block to install the button code](/v1/docs/install-web-scheduler-2-0-button-wordpress#use-a-custom-html-code-block-to-install-the-button-code) section to install the button code into WordPress.

### Workflows

### Retrieve button HTML code

Add a preset button element to your site and then copy that button's source HTML code to use in a custom HTML code block. If you already have the button HTML code on hand, you can skip this section and go straight to the [Use custom HTML code block to install button code](/v1/docs/install-web-scheduler-2-0-button-wordpress#use-a-custom-html-code-block-to-install-the-button-code) section.

1. In your company's WordPress website editor, click on the home icon in the upper left corner and then click *Visit Site*.![Cursor clicking click website editor](https://images.ctfassets.net/mb2ty0185mk8/55fLhNa7OyjFw1OEQxN7sY/386853ec0c0f648077fedce551142989/image10.png)
2. Then click *Edit Page* from the top navigation bar. ![Cursor clicking Edit Page](https://images.ctfassets.net/mb2ty0185mk8/6IfSKKvt3hKzj38PmlB95B/341e8166e3024a1c14eae67c323bcd58/image4.png)
3. In the site editor, click on the **+** icon at the top. ![Viewing plus icon in Wordpress](https://images.ctfassets.net/mb2ty0185mk8/2sBgl1CZDSLJ49a9I6q0bb/0bde95c855c883a532994c73691fb3e0/image6.png)
4. Search for and click the *Button* option to add a button element to your site. ![Cursor clicking Button option in Workdpress](https://images.ctfassets.net/mb2ty0185mk8/6Ku5WsupPPtfyvkp2fqLH1/a6015bfd1503f163d9977f94c45e223f/image2.png)
5. Enter the desired customer-facing text (for example, *Schedule Now!*) into the new button.
6. Click the 3 dots on the right in the new button menu, and select *Edit as HTML*. ![Viewing how to select Edit as HTML](https://images.ctfassets.net/mb2ty0185mk8/no5vkx3SlYc86XZMAVdUA/dad2f957bb101525fda0b4bf9a28eb99/image1.png)
7. Highlight and then copy the HTML code that appears in the box.![Viewing HTML code](https://images.ctfassets.net/mb2ty0185mk8/2FBEQ5xwgBvWQEI2ez2SNg/1e249752af0f207b91ec3163925cce2a/image9.png)
8. Delete the button element that was just added.
9. Move on to the next [Use a custom HTML code block to install the button code](/v1/docs/install-web-scheduler-2-0-button-wordpress#use-a-custom-html-code-block-to-install-the-button-code) section.

### Use a custom HTML code block to install the button code

1. In the WordPress site editor, click on the **+** icon at the top.![Viewing plus icon in the Wordpress](https://images.ctfassets.net/mb2ty0185mk8/ottfUXQq1Hywh9ukgb7gO/093e8fc075ffcf260ff1689e10e16717/image6.png)
2. Search for and click the *Custom HTML* option to add a custom HTML code block to your site. ![Viewing Custom HTML option](https://images.ctfassets.net/mb2ty0185mk8/4oYDnnJlFIW1bRMcD8jGtV/ff5edfea5ebfbf5921de04f7721f1a20/image3.png)
3. Paste your button HTML code into the custom HTML box.![Viewing HTML option](https://images.ctfassets.net/mb2ty0185mk8/lmu18wNPI3n2QgIJBmCBg/8510d84f07a9cd8713cd21a2e51cde99/image8.png)
4. Copy the following onclick attribute code:
  1. onclick=STWidgetManager("ws-open")
5. Paste the attribute code from step 12 into the custom HTML code block - it can be inserted into the opening tag (for example, <button **onclick=STWidgetManager("ws-open")**>Button Text</button>). ![Viewing how to past HTML code](https://images.ctfassets.net/mb2ty0185mk8/1yzXqlAnza6XtyNlvF2hrB/6a39c5f3de6f9ee8751de312a2f19517/image5.png)
6. Edit the button's design as needed.
7. Click *Preview* from the upper right corner of the website editor to preview the button and scheduler widget.
8. Once the scheduler button is satisfactory, click on *Update* from the upper right corner to save changes. ![Viewing Preview and Update options](https://images.ctfassets.net/mb2ty0185mk8/4L7TatpSoH1Lt1LsceiH9m/7d9c3c4661635a9652615f64269b6a25/image7.png)

### Want to learn more?

- See [Set Web Scheduler for Office Employees](/v1/docs/set-web-scheduler-for-office-employees)
- See [Can't add web scheduler code to a website](/v1/docs/cant-add-web-scheduler-code-to-a-website)
