Cleanup, Maintenance & Uninstallation

This guide covers how to clean up cached data, remove licenses, maintain your Docker environment, and completely uninstall WP Staging CLI.

Cleanup Commands

WP Staging CLI provides several cleanup commands to manage cached data and stored credentials.

Clean Cache Files

Remove cached API responses and temporary data:

wpstaging clean cache

Cache files include:

  • License validation responses
  • API response cache
  • Temporary download files

Cache is automatically cleaned during normal operation (entries older than 4 hours are removed on startup).

Remove Stored License

Remove the locally stored license key without deactivating it on the server:

wpstaging clean license

Use this when you want to:

  • Switch to a different license key
  • Re-enter your license key
  • Clear credentials without server communication

Note: This only removes the local license file. The license remains active on your WP Staging account. Use wpstaging deactivate to fully deactivate the license.

Clean Everything

Remove all cached data and stored credentials:

wpstaging clean all

This removes:

  • All cache files
  • Stored license key
  • Other temporary data in the working directory

Deactivate License

To fully deactivate your license on the WP Staging servers and remove local storage:

wpstaging deactivate

This command:

  • Contacts WP Staging servers to deactivate the license
  • Frees up a license slot on your account
  • Removes the local license file

Alias: You can also use wpstaging unregister.

Remove Docker Environment

If you’ve used the Docker features, remove all containers, volumes, and configurations:

wpstaging remove

Warning: This permanently removes all WordPress sites, databases, and Docker configurations. This action cannot be undone. You’ll be prompted for confirmation.

This command:

  • Stops all running containers
  • Removes all Docker volumes (including database data)
  • Removes all site configurations
  • Removes the entire ~/wpstaging directory (or custom --env-path)

Important: Run this before uninstalling WP Staging CLI if you’ve used the Docker features.

Uninstall WP Staging CLI

To completely remove WP Staging CLI from your system:

Step 1: Remove Docker Data (if used)

If you’ve used Docker features, first clean up:

wpstaging remove

Step 2: Run Uninstaller

Linux, macOS, WSL:

curl -fsSL https://wp-staging.com/uninstall.sh | bash

Windows PowerShell:

irm https://wp-staging.com/uninstall.ps1 | iex

Windows CMD:

curl -fsSL https://wp-staging.com/uninstall.cmd -o uninstall.cmd && uninstall.cmd && del uninstall.cmd

The uninstaller removes:

  • The wpstaging binary and aliases
  • PATH entries
  • Bash completion scripts (Linux/macOS)
  • License key environment variable
  • Cache directories (~/.wpstaging)

Manual Uninstallation

If you prefer to uninstall manually:

Linux, macOS:

# Remove the binary
rm ~/.local/bin/wpstaging
# Or if installed system-wide:
sudo rm /usr/local/bin/wpstaging

# Remove bash completion (if installed)
rm ~/.local/share/bash-completion/completions/wpstaging

# Remove license and cache data
rm -rf ~/.wpstaging

# Remove Docker environment (if used)
rm -rf ~/wpstaging

Windows PowerShell:

# Remove the binary
Remove-Item "$env:LOCALAPPDATA\Programs\wpstaging" -Recurse -Force

# Remove from PATH (manual step required)
# Go to System Properties > Environment Variables > User Variables > PATH
# Remove the wpstaging entry

# Remove license and cache data
Remove-Item "$env:USERPROFILE\.wpstaging" -Recurse -Force

# Remove Docker environment (if used)
Remove-Item "$env:USERPROFILE\wpstaging" -Recurse -Force

When to Use Each Option

ScenarioCommand
Clear temporary files and cachewpstaging clean cache
Switch to a different licensewpstaging clean license then wpstaging register
Stop using this license on this machinewpstaging deactivate
Remove all Docker sites and datawpstaging remove
Complete uninstallationwpstaging remove (if Docker used), then uninstall script
Reset everything but keep CLI installedwpstaging clean all + wpstaging remove

Cleanup Command Summary

CommandWhat It Removes
clean cacheCache files only
clean licenseLocal license file only (keeps active on server)
clean allCache + local license + other temporary data
deactivateDeactivates on server + removes local license
removeAll Docker containers, volumes, sites, configs

Updated on January 27, 2026