Skip to content

Instantly share code, notes, and snippets.

Created December 9, 2013 13:26
What would you like to do?
[Jetpack] Force deactivate all modules but stats
// 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