Skip to content

Instantly share code, notes, and snippets.

@lukecav
Last active January 31, 2019 18:32
Show Gist options
  • Save lukecav/88af3762551f46c51f060600080496ae to your computer and use it in GitHub Desktop.
Save lukecav/88af3762551f46c51f060600080496ae to your computer and use it in GitHub Desktop.
Use WP-CLI to delete all Jetpack option values and cron events after uinstalling
# delete all jetpack option values and cron events
wp db query "DELETE FROM $(wp db prefix --allow-root)options WHERE option_name LIKE 'jpsq\_%'" --allow-root
wp db query "DELETE FROM $(wp db prefix --allow-root)options WHERE option_name LIKE 'jetpack%'" --allow-root
wp db query "DELETE FROM $(wp db prefix --allow-root)options WHERE option_name LIKE '%jetpack%'" --allow-root
wp cron event delete jp_purge_transients_cron
wp cron event list --allow-root | grep jp_ | awk '{ print $1 }' | xargs --replace=% wp cron event delete % --allow-root
wp cron event list --allow-root | grep jetpack_ | awk '{ print $1 }' | xargs --replace=% wp cron event delete % --allow-root