MainWP Community

Delete Jetpack Created Options for Database Cleanup

Remove Jetpack plugin created options for database cleanup on child sites.

Snippet Type

Execute on Child Sites

Snippet

global $wpdb;

$plugin_options = $wpdb->get_results( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE 'jetpack_%'" );

foreach( $plugin_options as $option ) {
    delete_option( $option->option_name );
}
3 Likes

Does not include _transient_timeout_jetpack_% option cleanup at the moment.

Also does not include _transient_jetpack_% options in the cleanup.

All options that the Jetpack plugin creates are as follows.

_transient_jetpack_a8c_data	
_transient_jetpack_assumed_site_creation_date	
_transient_jetpack_file_data_8.1.1	
_transient_jetpack_https_test	
_transient_jetpack_https_test_message	
_transient_jetpack_idc_allowed	
_transient_jetpack_is_single_user	
_transient_jetpack_plugin_api_action_links_refresh	
_transient_jetpack_psh_status	
_transient_jetpack_sync_callables_await	
_transient_jetpack_sync_constants_await	
_transient_jetpack_sync_last_checked_queue_state_sync
_transient_timeout_jetpack_a8c_data	
_transient_timeout_jetpack_file_data_8.1.1	
_transient_timeout_jetpack_https_test	
_transient_timeout_jetpack_https_test_message	
_transient_timeout_jetpack_idc_allowed	
_transient_timeout_jetpack_is_single_user	
_transient_timeout_jetpack_plugin_api_action_links_refresh	
_transient_timeout_jetpack_psh_status	
_transient_timeout_jetpack_sync_callables_await	
_transient_timeout_jetpack_sync_constants_await	
_transient_timeout_jetpack_sync_last_checked_queue_state_sync
jetpack_ab_connect_banner_green_bar	
jetpack_activated	
jetpack_activation_source	
jetpack_active_modules	
jetpack_active_plan	
jetpack_available_modules	
jetpack_callables_sync_checksum	
jetpack_constants_sync_checksum	
jetpack_content_blog_display	
jetpack_content_post_details_author	
jetpack_content_post_details_categories	
jetpack_content_post_details_comment	
jetpack_content_post_details_date	
jetpack_content_post_details_tags	
jetpack_last_connect_url_check	
jetpack_log	
jetpack_next_sync_time	
jetpack_next_sync_time_full_sync	
jetpack_next_sync_time_full-sync-enqueue	
jetpack_next_sync_time_sync	
jetpack_options	
jetpack_plugin_api_action_links	
jetpack_private_options	
jetpack_secrets	
jetpack_security_report	
jetpack_sync_full__constants_config	
jetpack_sync_full__constants_queued	
jetpack_sync_full__constants_sent	
jetpack_sync_full__constants_sent_total	
jetpack_sync_full__constants_total	
jetpack_sync_full__finished	
jetpack_sync_full__functions_config	
jetpack_sync_full__functions_queued	
jetpack_sync_full__functions_sent	
jetpack_sync_full__functions_sent_total	
jetpack_sync_full__functions_total	
jetpack_sync_full__options_config	
jetpack_sync_full__options_queued	
jetpack_sync_full__options_sent	
jetpack_sync_full__options_sent_total	
jetpack_sync_full__options_total	
jetpack_sync_full__params	
jetpack_sync_full__queue_finished	
jetpack_sync_full__send_started	
jetpack_sync_full__sent_started	
jetpack_sync_full__started	
jetpack_sync_full__users_sent	
jetpack_sync_full__users_sent_total	
jetpack_sync_full_config	
jetpack_sync_full_enqueue_status	
jetpack_sync_https_history_home_url	
jetpack_sync_https_history_main_network_site_url	
jetpack_sync_https_history_site_url	
jetpack_sync_settings_avoid_wp_cron	
jetpack_sync_settings_comment_meta_whitelist	
jetpack_sync_settings_cron_sync_time_limit	
jetpack_sync_settings_dequeue_max_bytes	
jetpack_sync_settings_disable	
jetpack_sync_settings_enqueue_wait_time	
jetpack_sync_settings_full_sync_limits	
jetpack_sync_settings_full_sync_send_duration	
jetpack_sync_settings_full_sync_sender_enabled	
jetpack_sync_settings_known_importers	
jetpack_sync_settings_max_enqueue_full_sync	
jetpack_sync_settings_max_queue_lag	
jetpack_sync_settings_max_queue_size	
jetpack_sync_settings_max_queue_size_full_sync	
jetpack_sync_settings_meta_blacklist	
jetpack_sync_settings_post_meta_whitelist	
jetpack_sync_settings_post_types_blacklist	
jetpack_sync_settings_queue_max_writes_sec	
jetpack_sync_settings_render_filtered_content	
jetpack_sync_settings_sync_sender_enabled	
jetpack_sync_settings_sync_via_cron	
jetpack_sync_settings_sync_wait_threshold	
jetpack_sync_settings_sync_wait_time	
jetpack_sync_settings_taxonomies_blacklist	
jetpack_sync_settings_term_relationships_full_sync_item_size	
jetpack_sync_settings_upload_max_bytes	
jetpack_sync_settings_upload_max_rows	
jetpack_testimonial	
jetpack_tos_agreed	
jetpack_unique_connection	
jetpack_updates	
jetpack_updates_sync_checksum
2 Likes

About half of those options related to Jetpack are being autoloaded lol.

1 Like