wp-webhook-netlify-deploy
wp-webhook-netlify-deploy copied to clipboard
🚢 WP Plugin that adds functionality to easily send Netlify Webhook requests
WP Webhook Netlify Deploy
Description
Easily deploy static sites using Wordpress and Netlify
Build Quickly and easily send webhooks to build your Netlify
Schedule Schedule daily, weekly or monthly builds
Status Check the status of your latest build to see if it was successful without even leaving Wordpress
NOTE: this plugin does not create a static version of your WordPress site. The plugin simply fires off a build request to Netlify, to rebuild your netlify hosted site (which is assumed to be pulling in WordPress data as a headless CMS).
Installation
From your WordPress dashboard
- Visit Plugins > Add New
- Search for "Deploy Webhook Button"
- Install plugin
- Activate the plugin
- Click on the new menu item "Deploy Netlify Webhook" and enter your site details/keys
- Enter enter your site_id, webhook POST address, Netlify API Key, and User-Agent
- Read the documentation to get started
Where do I get the field data from?
Webhook Build
- Visit Netlify > Site-Name > Settings > Build & Deploy
- Create A Build Hook (or use an existing hook)
- Copy The Build Hook URL into the
Webhook Build URLfield
Netlify site_id
- Visit Netlify > Site-Name > Settings
- Copy APP_ID and paste into the
Netlify site_idfield
Netlify API Key
- Visit Netlify > User Settings > Applications > Personal Access Tokens
- Create A Personal Access Token (or use an existing one)
- Copy The token and paste into the
Netlify API Keyfield
User-Agent Site Value
- Visit Netlify > Site-Name > Settings
- Copy The Site Name and paste into the
User-Agent Site Valuefield - Add The site url in brackets to the
User-Agent Site Valuefield - Your field should look similar to this
SiteNameNoSpaces (site-name-url.com)
Scheduling Netlify Builds
Is it possible to set daily, weekly, or monthly builds. Using this plugin. Navigate to the 'Schedule Builds' settings page to select build time and date.
Consistant Scheduling
WordPress cron jobs are not 100% reliable as they are only fired when the site is visited. A little bit of work may be required to fix this.
If you have access to your hosting cPanel
- Add the following to your
wp-config.phpfile -define('DISABLE_WP_CRON', true); - Create a system cron
Creating a System Cron Job
- Log into your systems cpanel.
- Navigate to the Cron Jobs section - Search for "cron"
- Click "Cron Jobs" (If this does not show up you may not have access to this functionality)
- Select "Once per hour" from the common settings
- Add this command to the command input
wget -q -O - https://your-domain.com/wp-cron.php?doing_wp_cron
If you do not have access to your cPanel
A solution to not being able to set up cPanel cron jobs is to use a third party scheduler. This ensures that at a certain time every day your WordPress cron events will fire.
- Set up an account with https://cron-job.org
- Login and navigate to "Cronjobs"
- Create a new cron job for
https://your-domain.com/wp-cron.php?doing_wp_cronfiring a minimum of once an hour every hour.
Now the Netlify hook (and all other cron jobs on your site) will run on time.
Admin Bar
A deploy button and the status badge of the last build is added to the admin bar. By default this will only be displayed to users that can manage_options.
You may allow other user roles with these three filters:
add_filter('netlify_status_capability', function() {
return 'edit_pages';
});
add_filter('netlify_deploy_capability', function() {
return 'edit_pages';
});
add_filter('netlify_adjust_settings_capability', function() {
return 'edit_pages';
});
Screenshots
Main Plugin page
Links
Changelog
View full changelog: here




