Last active
January 31, 2019 18:32
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://guides.wp-bullet.com/clean-jetpack-database-bloat-after-uninstalling-from-wordpress/
https://wordpress.stackexchange.com/questions/176719/how-to-remove-wordpress-jetpack-plugin-completely
https://developer.wordpress.org/cli/commands/db/query/
https://developer.wordpress.org/cli/commands/cron/event/delete/
https://developer.wordpress.org/cli/commands/cron/event/list/