Skip to content

Instantly share code, notes, and snippets.

@maddisondesigns
Last active January 24, 2023 20:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maddisondesigns/3b230570a7dc0e68e3dcdcb52e6f3d8a to your computer and use it in GitHub Desktop.
Save maddisondesigns/3b230570a7dc0e68e3dcdcb52e6f3d8a to your computer and use it in GitHub Desktop.
Hide those annoying Automattic/WooCommerce/Jetpack/WordPress adverts & promos
<?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