Jetpack: Add filters to disable every JP module

Created on 9 Mar 2017  路  4Comments  路  Source: Automattic/jetpack

I don't think this functionality currently exists, but if it does, close this.

Most helpful comment

I think such a filter would deactivate the module and stops its auto-activation as well in the future.

I think if they're going so far as to write code to filter the module list, they can go the extra (small) steps it takes to deactivate it. Plus, deactivating a module is a one-off event which doesn't need a persistent filter.

Closing as wontfix as the jetpack_get_available_modules filter satisfies the needs of filtering out which modules are available, and there are numerous ways to manually deactivate modules via code, CLI, or UI.

All 4 comments

Like this?

function jetpackme_force_deactivate_rp() {
    if ( class_exists( 'Jetpack' ) ) {
        Jetpack::deactivate_module( 'related-posts' );
    }
}
add_action( 'init', 'jetpackme_force_deactivate_rp' );

or something like this:
https://jeremy.hu/customize-the-list-of-modules-available-in-jetpack/
?

I am unsure of the difference, but it needs to be able to disable a module and not just upon activating Jetpack. @jeherve probably has a better idea than me.

something like this:
https://jeremy.hu/customize-the-list-of-modules-available-in-jetpack/

This stops auto-activation, but doesn't actually deactivate modules.

Jetpack::deactivate_module( 'related-posts' );

Something along those lines, yes, but ideally I think such a filter would deactivate the module and stops its auto-activation as well in the future.

I think such a filter would deactivate the module and stops its auto-activation as well in the future.

I think if they're going so far as to write code to filter the module list, they can go the extra (small) steps it takes to deactivate it. Plus, deactivating a module is a one-off event which doesn't need a persistent filter.

Closing as wontfix as the jetpack_get_available_modules filter satisfies the needs of filtering out which modules are available, and there are numerous ways to manually deactivate modules via code, CLI, or UI.

Was this page helpful?
0 / 5 - 0 ratings