WP-CLI Redeploy Command
Use wp staatic redeploy to deploy an existing Staatic publication again from WP-CLI. It reuses a publication that has already finished crawling and deploys it with the currently configured deployment method.
Do not use redeploy when you need fresh content from WordPress. Use the Publish Command for that.
Syntax
wp staatic redeploy <id> [--[no-]force] [--[no-]verbose]
The <id> argument is required and must be the ID of an existing Staatic publication.
A successful redeploy prints deployment progress similar to this:
Setting up
Initializing deployment
Deploying WordPress site
Deploying... 100% [=======================] 0:00 / 0:00
Finishing deployment
Finishing
Success: Publication finished in 3 seconds!
Options
| Option | Default | Description |
|---|---|---|
<id> |
required | Source publication ID. The source publication must exist and must have finished crawling. |
--[no-]force |
--no-force |
Cancel the publication currently in progress before starting the redeploy. |
--[no-]verbose |
--no-verbose |
Include publication logs in the command output. Task names and progress bars are shown even without --verbose. |
wp staatic redeploy starts from an existing crawled build, so build-selection flags such as --preview, --no-deploy, --partial, --merge, --only-urls, and --only-paths do not apply.
What redeploy does
Redeploy creates a new publication record from an existing crawled build.
| Behavior | Detail |
|---|---|
| Source content | Reuses the build from the source publication ID. Crawling and post-processing are skipped. |
| Deployment settings | Uses the currently active deployment method and settings. This means a redeploy can send the same build to a newly configured destination. |
| Preview state | Inherits the source publication’s preview or live state. There is no --preview flag for redeploy. |
| Deployment | Always runs deployment. There is no --no-deploy flag because redeployment is the purpose of the command. |
| Publication in progress | Stops unless --force is used. |
Redeploy cannot pick up new posts, changed settings that affect generated HTML, updated redirects, or changed assets from WordPress. Run a fresh publication when the site output itself needs to change.
Examples
Redeploy an existing publication:
wp staatic redeploy abc-def-123
Redeploy with log output:
wp staatic redeploy abc-def-123 --verbose
Cancel the current publication and redeploy the selected publication:
wp staatic redeploy abc-def-123 --force
Failure cases
Common failure cases:
- the publication ID is missing;
- the publication ID cannot be found;
- the source publication has not finished crawling;
- another publication is in progress and
--forceis not used; - the selected deployment method is missing or fails validation;
- a deployment task fails or the redeploy is canceled while running.
Failed redeployments are marked as failed in Staatic. Review the command output and Staatic logs to identify the failed task.