This commit is contained in:
Matt Silverlock 2026-01-10 19:54:14 +00:00 committed by GitHub
commit c968479763
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 0 deletions

View file

@ -74,6 +74,20 @@ New versions are not created when you make changes to [resources connected to yo
See examples of creating a Worker, Versions, and Deployments directly with the API, library SDKs, and Terraform in [Infrastructure as Code](/workers/platform/infrastructure-as-code/).
### Delete a version
To delete a version that is not currently deployed, use the [`wrangler versions delete`](/workers/wrangler/commands/#versions-delete) command:
```sh
npx wrangler versions delete <VERSION_ID> --name <WORKER_NAME>
```
You will be prompted to confirm the deletion. Use `--yes` to skip the confirmation prompt in CI environments.
:::note
You cannot delete a version that is actively serving traffic. Remove the version from the active deployment first.
:::
### View versions and deployments
#### Via Wrangler

View file

@ -729,6 +729,12 @@ For example:
<WranglerCommand command="versions view" headingLevel={3} />
<WranglerCommand
command="versions delete"
description="Delete a specific [version](/workers/configuration/versions-and-deployments/#versions) of your Worker. A version can only be deleted if it is not actively deployed."
headingLevel={3}
/>
<WranglerCommand command="versions secret put" headingLevel={3} />
<WranglerCommand command="versions secret delete" headingLevel={3} />