Tips on Customizing Google Analytics Dashboard Plugin for WordPress by MonsterInsights

How to Hide Google Analytics for WordPress by MonsterInsights Admin Menus

function plt_hide_google_analytics_for_wordpress_menus() {
	//Hide "Dashboard → Insights".
	remove_submenu_page('index.php', 'admin.php?page=monsterinsights_reports');

	//Hide "Insights".
	remove_menu_page('monsterinsights_reports');
	//Hide "Insights → Reports".
	remove_submenu_page('monsterinsights_reports', 'monsterinsights_reports');
	//Hide "Insights → Settings".
	remove_submenu_page('monsterinsights_reports', 'monsterinsights_settings');
	//Hide "Insights → Tools".
	remove_submenu_page('monsterinsights_reports', 'http://127.0.0.1/wp-admin/admin.php?page=monsterinsights_settings#/tools');
	//Hide "Insights → Addons".
	remove_submenu_page('monsterinsights_reports', 'http://127.0.0.1/wp-admin/admin.php?page=monsterinsights_settings#/addons');
	//Hide "Insights → About Us".
	remove_submenu_page('monsterinsights_reports', 'http://127.0.0.1/wp-admin/admin.php?page=monsterinsights_settings#/about');
}

add_action('admin_menu', 'plt_hide_google_analytics_for_wordpress_menus', 11);

Where do I put this code?

How to Hide the "MonsterInsights" Dashboard Widget

function plt_hide_google_analytics_for_wordpress_dashboard_widgets() {
	$screen = get_current_screen();
	if ( !$screen ) {
		return;
	}

	//Remove the "MonsterInsights" widget.
	remove_meta_box('monsterinsights_reports_widget', 'dashboard', 'normal');
}

add_action('wp_dashboard_setup', 'plt_hide_google_analytics_for_wordpress_dashboard_widgets', 20);