Documentation

WP-CLI

Staatic’s WP-CLI commands start or redeploy a publication from the command line, for example from cron or a deployment script. The command runs the publication 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, and with Staatic Premium --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.

Publish Command

Start a Staatic publication from the command line with the WP-CLI publish command: syntax, flags, examples, caveats, and common failure cases.

Redeploy Command

Redeploy an existing Staatic publication without crawling WordPress using WP-CLI: syntax, options, behavior, examples, and common failure cases.