I know we have the following command available in WP-CLI to remove transients

# Delete all transients
$ wp transient delete-all

However, my question is does it remove transients on all sites over multi sites? If not how can we remove transients on all sites?


You can run any command against all sites in a network by combining the wp site list and the | xargs:

wp site list --field=url | xargs -n1 -I % wp --url=% transient delete --all

Source: https://runcommand.io/to/run-wp-cli-command-wordpress-multisite/

| improve this answer | |
  • So, does wp transient delete --all --network ONLY delete network-level transients then, not all transients in the network (also on sub-sites)? – Adam Jan 5 '17 at 14:52
  • @david, i think its missing a space and dash in: transient delete --all – pcarvalho Oct 30 '18 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.