Skip to content

WP-CLI

Staatic’s WP-CLI commands start or redeploy a publication from the command line, for example from cron or a deployment script. Each command does the work itself and returns when it has finished.

Publish

wp staatic publish crawls WordPress and deploys a new publication with your current Staatic settings. To publish every night, add it to the crontab of the web server user and point WP-CLI at the WordPress installation with --path:

0 3 * * * wp --path=/var/www/example.com staatic publish

Use --only-urls or --only-paths to publish only a few pages. With Staatic Premium, use --partial to publish only what changed since the active publication. Read about selective publications before you use them without an active Premium subscription. The Publish Command page lists every option.

Redeploy

wp staatic redeploy deploys an existing publication again without crawling WordPress, for example after a deployment step failed or after you replaced an expired access token:

wp staatic redeploy 3f1c2a9e-8b4d-4c7a-9e21-5d6f0b7a8c34

The Redeploy Command page explains where to find the publication ID and what redeploy reuses.

In this section