Hi
Add to the functions.php file:
add_action('admin_head', 'ahirwp_custom_style');
function ahirwp_custom_style() {
echo '<style>
.components-card.is-size-medium.woocommerce-marketing-knowledgebase-card.woocommerce-marketing-knowledgebase-card__category-marketing.woocommerce-admin-marketing-card.css-1xs3c37-CardUI.e1q7k77g0 {
display: none;
}
</style>';
}
Thanks
Ahir Hemant
Hi, thank for your reply. But it just hide the html dom. Do you have any solution remove/stop service? Because it call to another api and link to out admin.
Thanks
Try this
add_filter( 'woocommerce_marketing_menu_items', '__return_empty_array' );
Or this
function wc_disable_marketing_hub( $marketing_pages ) {
return array();
}
add_filter( 'woocommerce_marketing_menu_items', 'wc_disable_marketing_hub' );
Or try this
/**
* Option - Remove marketing features - basic example to demonstrate usage
*/
add_filter(
'woocommerce_admin_get_feature_config',
function ( $features ) {
$features['coupons'] = false;
$features['marketing'] = false;
return $features;
}
);
/**
* Option - Remove marketing features - basic example to demonstrate usage
*/
add_filter( 'woocommerce_admin_features', 'disable_features' );
function disable_features( $features ) {
$marketing = array_search('marketing', $features);
unset( $features[$marketing] );
//$coupons = array_search('coupons', $features);
//unset( $features[$coupons] );
//array_values( $features );
return $features;
}
Thanks
Ahir Hemant
Hi, thank for your help. But with your code we will miss the marketing feature (coupons).
Thanks
Hi @datverse,
If the snippets kindly provided by @hemant-ahir do not meet your requirements, we suggest reaching out to a developer from one of the official WooCommerce services at https://woocommerce.com/customizations/ who can help you create a custom-made solution.