Skip to main content

Configuring Build Hooks

What Are Build Hooks?

Build hooks enable certain events in the CMS to trigger builds of a decoupled frontend; such as content updates to post, or publishing a new page.

Installing the WP Webhooks Plugin

If you are using the Decoupled WordPress Composer Managed starter template, the WP Webhooks plugin will already be included as a Composer dependency. It will need to be activated in the WordPress admin dashboard.

For other projects, install and activate the WP Webhooks Plugin as outlined in the plugin documentation.

Creating a Build Hook That Triggers When a Post Is Published

  1. After generating a build hook on your build platform, navigate to your WordPress admin dashboard and open the WP Webhooks settings.
  2. Click on the Send Data tab.
  3. Select the Post Updated Webhook trigger.
  4. Click Add Webhook URL, name the hook and paste the build hook URL that you generated in the Webhook URL field. Submit this form.
  5. Under the Action menu for the hook you created, select settings.
  6. Under the Trigger on post status setting enter publish and toggle the fire only once per instance option on. Save your settings.

Testing Your Build Hook

  1. Open your WordPress admin dashboard.
  2. Create a new Post or update a previously existing one.
  3. Observe that a new build has been triggered on your build platform.