WP Staging CLI requires a valid WP Staging Pro license (Agency or Developer plan) to extract or restore backups. This guide explains how to register and manage your license.
Register Your License (Recommended)
The easiest way to use your license is to register it once. After registration, your license key is encrypted and stored locally, so you don’t need to enter it again.
Interactive Mode:
wpstaging registerYou’ll be prompted to enter your license key. The CLI will validate it with WP Staging servers and store it securely.
Non-Interactive Mode (for scripts/automation):
wpstaging register --license=YOUR_LICENSE_KEYAfter registration: You can run any command without the --license flag. Your license key is encrypted and validated automatically.
Alternative Methods
If you prefer not to store your license, you can provide it in other ways:
Environment Variable
Set the WPSTGPRO_LICENSE environment variable to use your license without storing it:
Linux, macOS, WSL:
# Set for current session
export WPSTGPRO_LICENSE=YOUR_LICENSE_KEY
# Or add to ~/.bashrc or ~/.zshrc for permanent use
echo 'export WPSTGPRO_LICENSE=YOUR_LICENSE_KEY' >> ~/.bashrcWindows PowerShell:
# Set for current session
$env:WPSTGPRO_LICENSE="YOUR_LICENSE_KEY"
# Or add to your PowerShell profile for permanent use
Add-Content $PROFILE 'export WPSTGPRO_LICENSE="YOUR_LICENSE_KEY"'Windows CMD:
set WPSTGPRO_LICENSE=YOUR_LICENSE_KEYPer-Command Flag
You can also provide your license key directly on each command:
wpstaging extract --license=YOUR_LICENSE_KEY backup.wpstg
wpstaging restore --license=YOUR_LICENSE_KEY --path=/var/www/html backup.wpstgDeactivate License
To deactivate your license on the WP Staging servers and remove the stored key:
wpstaging deactivateThis command:
- Contacts WP Staging servers to deactivate your license
- Removes the stored license key from your local machine
- Frees up a license slot on your account
Alias: You can also use wpstaging unregister as an alternative to deactivate.
Remove Stored License (Local Only)
To remove only the locally stored license without deactivating it on the server:
wpstaging clean licenseThis only removes the local license file. The license remains active on your WP Staging account. Use this if you want to switch to a different license or re-enter your key.
License Priority Order
WP Staging CLI checks for a license in this order:
- Command-line flag:
--license=KEY - Environment variable:
WPSTGPRO_LICENSE - Stored license: From
wpstaging register
The first valid license found is used.
Troubleshooting
License Validation Failed
If you see a license validation error:
- Verify your license key is correct
- Check that your WP Staging subscription is active
- Ensure you have an Agency or Developer license (not Personal)
- Check your internet connection
License Already Activated
Each license can be activated on a limited number of devices. If you’ve reached your limit:
- Deactivate the license on an unused device:
wpstaging deactivate - Or purchase additional license slots at wp-staging.com
Cannot Connect to License Server
If the CLI cannot reach WP Staging servers:
- Check your internet connection
- Verify that
wp-staging.comis accessible from your network - If behind a corporate firewall, ensure outbound HTTPS traffic is allowed
Next Steps
With your license registered, you’re ready to start using WP Staging CLI: