Last active
January 24, 2023 20:44
-
-
Save maddisondesigns/3b230570a7dc0e68e3dcdcb52e6f3d8a to your computer and use it in GitHub Desktop.
Hide those annoying Automattic/WooCommerce/Jetpack/WordPress adverts & promos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Turn off WooCommerce Marketplace suggestions | |
*/ | |
add_filter( 'woocommerce_allow_marketplace_suggestions', '__return_false' ); | |
/** | |
* Turn off WooCommerce Feature Plugin notice | |
*/ | |
add_filter( 'woocommerce_show_admin_notice', '__return_false', 'wc_admin_feature_plugin_notice' ); | |
/** | |
* Turn off WooCommerce.com connection notice | |
*/ | |
add_filter( 'woocommerce_helper_suppress_connect_notice', '__return_true' ); | |
/** | |
* Remove 'connect your store to WooCommerce.com' notice | |
*/ | |
add_filter( 'woocommerce_helper_suppress_admin_notices', '__return_true' ); | |
/** | |
* Remove Jetpack Ads | |
*/ | |
add_filter( 'jetpack_just_in_time_msgs', '__return_false' ); | |
/** | |
* Remove Site Health and PHP Dashboard Widgets | |
*/ | |
function remove_site_wp_dashboard_widgets() { | |
remove_meta_box( 'dashboard_site_health', 'dashboard', 'normal' ); | |
remove_meta_box( 'dashboard_php_nag', 'dashboard', 'normal' ); | |
} | |
add_action( 'wp_dashboard_setup', 'remove_site_wp_dashboard_widgets' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment