Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Jetpack] Force deactivate all modules but stats
<?php
// Force deactivate all Jetpack modules, except for stats
function jeherve_force_deactivate_everything_but_stats() {
if ( class_exists( 'Jetpack_Options' ) )
Jetpack_Options::update_option( 'active_modules', array_unique( array( 'stats' ) ) );
}
add_action( 'init', 'jeherve_force_deactivate_everything_but_stats' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.