How to load only a specific Jetpack module

Sometimes you do not want to see a specific module in the Jetpack menu. You might not use it at all, or you might want to make sure other admins can’t activate it. For such cases, you can use the jetpack_get_available_modules filter to control the list of modules available in Jetpack.

Load only a specific Jetpack module

function tweakjp_only_stats ( $modules ) {
    $return = array();
    $return['stats'] = $modules['stats'];
    return $return;
}
add_filter( 'jetpack_get_available_modules', 'tweakjp_only_stats' );

Disable a specific module

function tweakjp_disable_stats ( $modules ) {
    unset( $modules['stats'] );
    return $modules;
}
add_filter( 'jetpack_get_available_modules', 'tweakjp_disable_stats' );

Entdecke die Vorteile von Jetpack

Erfahre, wie Jetpack deine WordPress-Website schützen, beschleunigen und beim Wachstum unterstützen kann.

Tarife entdecken

Hast du eine Frage?

Kommentare sind für diesen Artikel geschlossen, aber wir helfen dir trotzdem gerne weiter! Besuche das Support-Forum – wir beantworten dort gerne deine Fragen.

Support-Forum anzeigen