Skip to content

Instantly share code, notes, and snippets.

@jeherve
Created December 9, 2013 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jeherve/7872205 to your computer and use it in GitHub Desktop.
Save jeherve/7872205 to your computer and use it in GitHub Desktop.
[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