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. You can find it as the id value in the URL of the publication’s Details page under Staatic > Publications.
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. Generated files such as netlify.toml or .htaccess come from the original build, so after switching deployment methods, run a new publication instead. |
| 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
Errors
When a redeploy fails, the command prints the error and exits with a non-zero status. The new publication is also marked as failed under Staatic > Publications.
| Message | What to do |
|---|---|
Unable to find source publication "…" |
Check the ID. It is the id value in the URL of the publication’s Details page. |
Source publication "…" has not finished crawling |
Choose a publication that finished crawling, or run the Publish Command for a new build. |
Unable to publish; another publication is pending |
Wait for the running publication to finish, or add --force to cancel it. |
Publication failed during … task with error …: The publication process took too long and was canceled. |
Raise the Publication Time Limit. |
Publication failed during … task with error … |
Run the command again with --verbose to see the publication log, and check the deployment settings. |
Publication was canceled |
The redeploy was canceled in the WordPress admin, or by another command with --force. Run it again. |