Please note that the above-mentioned approach to remove the Marketing Hub from WooCommerce doesn’t work anymore since v4.3. If you are using WooCommerce up to v4.2, the above method will work perfectly.
If you are using WooCommerce v4.3 (which you should), please remove the above-mentioned one-liner snippet and instead use the following snippet to remove Marketing Hub from WooCommerce Admin.
// Remove WooCommerce Marketing Hub Menu from the sidebar - for WooCommerce v4.3+
add_filter( 'woocommerce_admin_features', function( $features ) {
/**
* Filter the list of features and get rid of the features not needed.
*
* array_values() are being used to ensure that the filtered array returned by array_filter()
* does not preserve the keys of initial $features array. As key preservation is a default feature
* of array_filter().
*/
return array_values(
array_filter( $features, function($feature) {
return $feature !== 'marketing';
} )
);
} );
If you are looking for a detailed explanation of the above snippet, please check this gist: https://gist.github.com/isaumya/89f48dcd84cb58af1e668bb76ba2c029
Kind note to any moderator watching this reply, if possible please pin this reply, so that it can help others without digging much.