Skip to content

Instantly share code, notes, and snippets.

@MarcWoodyard
Forked from jeherve/plugin.php
Created September 6, 2016 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcWoodyard/f296f10c03a8c1f429a398161fc8dc02 to your computer and use it in GitHub Desktop.
Save MarcWoodyard/f296f10c03a8c1f429a398161fc8dc02 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