Skip to content

Instantly share code, notes, and snippets.

Created February 28, 2014 03:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/9264623 to your computer and use it in GitHub Desktop.
Save anonymous/9264623 to your computer and use it in GitHub Desktop.
Disable Jetpack modules by Robert Neu, http://wpbacon.com/tutorials/disable-jetpack-modules/
<?php
/**
* Disable all non-whitelisted jetpack modules.
*
* This will allow all of the currently available Jetpack modules to work
* normally. If there's a module you'd like to disable, simply comment it out
* or remove it from the whitelist and it will no longer load.
*
* @author FAT Media, LLC
* @link http://wpbacon.com/tutorials/disable-jetpack-modules/
*/
add_filter( 'jetpack_get_available_modules', 'prefix_kill_all_the_jetpacks' );
function prefix_kill_all_the_jetpacks( $modules ) {
// A list of Jetpack modules which are allowed to activate.
$whitelist = array(
'after-the-deadline',
'carousel',
'comments',
'contact-form',
'custom-css',
'enhanced-distribution',
'gplus-authorship',
'gravatar-hovercards',
'infinite-scroll',
'json-api',
'latex',
'likes',
'minileven',
'mobile-push',
'monitor',
'notes',
'omnisearch',
'photon',
'post-by-email',
'publicize',
'sharedaddy',
'shortcodes',
'shortlinks',
'sso',
'stats',
'subscriptions',
'tiled-gallery',
'vaultpress',
'videopress',
'widget-visibility',
'widgets',
);
// Deactivate all non-whitelisted modules.
$modules = array_intersect_key( $modules, array_flip( $whitelist ) );
return $modules;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment