Can’t deactivate Stats module in 12.0

[ad_1]

Hi Scott,

That’s indeed a bug that was introduced in the latest release, and will happen on sites using the VideoPress feature; we inadvertently enabled the full Stats feature in an effort to enable access to video play stats.

We’ll fix this in the next release (you can follow our progress on this in this GitHub issue), but until then you can force disable the Stats module, and ensure it will not be enabled again, by adding the following code snippet to your site using a functionality plugin:

// Deactivate the Stats module.
add_filter(
	'jetpack_active_modules',
	function ( $modules ) {
		$stats_index = array_search( 'stats', $modules, true );
		if ( false !== $stats_index ) {
			unset( $modules[ $stats_index ] );
		}
		return $modules;
	},
	11
);

// Remove the Stats module from the list of available modules.
add_filter(
	'jetpack_get_available_modules',
	function ( $modules ) {
		unset( $modules['stats'] );
		return $modules;
	},
	11
);

Sorry for the trouble!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer