apply_filters ( 'jetpack_get_available_modules', array $modules, string $min_version, string $max_version, bool $requires_connection, bool $requires_user_connection )

Filters the array of modules available to be activated.

Source file: jetpack_vendor/automattic/jetpack-status/src/class-modules.php

View in GitHub



(array) Array of available modules.


(string) Minimum version number required to use modules.


(string) Maximum version number required to use modules.


(bool) Value of the Requires Connection filter.


(bool) Value of the Requires User Connection filter.


Since: Jetpack 2.4.0


That filter allows you to change the list of modules that can be activated and deactivated by admins. For example, if you didn’t want anyone to be able to activate the Stats module on your site, you could do this:

function jeherve_kill_stats( $modules, $min_version, $max_version ) {
    unset( $modules['stats'] );
    return $modules;
add_filter( 'jetpack_get_available_modules', 'jeherve_kill_stats', 20, 3 );

Have a note to contribute?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


  1. Viktor Szépe says:
    // Enable only Jetpack Search
        static function ($modules) {
            return array_intersect_key($modules, ['search' => true]);