Tips on Customizing WP Statistics – The Most Popular Privacy-Friendly Analytics Plugin

How to Hide WP Statistics Admin Menus

function plt_hide_wp_statistics_menus() {
	//Hide "Statistics".
	remove_menu_page('wps_overview_page');
	//Hide "Statistics → Overview".
	remove_submenu_page('wps_overview_page', 'wps_overview_page');
	//Hide "Statistics → Online".
	remove_submenu_page('wps_overview_page', 'wps_online_page');
	//Hide "Statistics → Views".
	remove_submenu_page('wps_overview_page', 'wps_hits_page');
	//Hide "Statistics → Visitors".
	remove_submenu_page('wps_overview_page', 'wps_visitors_page');
	//Hide "Statistics → Referrers".
	remove_submenu_page('wps_overview_page', 'wps_referrers_page');
	//Hide "Statistics → Search Engines".
	remove_submenu_page('wps_overview_page', 'wps_searches_page');
	//Hide "Statistics → Content Analytics".
	remove_submenu_page('wps_overview_page', 'wps_content-analytics_page');
	//Hide "Statistics → Author Analytics".
	remove_submenu_page('wps_overview_page', 'wps_author-analytics_page');
	//Hide "Statistics → Category Analytics".
	remove_submenu_page('wps_overview_page', 'wps_category-analytics_page');
	//Hide "Statistics → Devices".
	remove_submenu_page('wps_overview_page', 'wps_devices_page');
	//Hide "Statistics → Top Visitors".
	remove_submenu_page('wps_overview_page', 'wps_top-visitors_page');
	//Hide "Statistics →".
	remove_submenu_page('wps_overview_page', 'wps_break_menu');
	//Hide "Statistics → Add-Ons".
	remove_submenu_page('wps_overview_page', 'wps_plugins_page');
	//Hide "Statistics → Privacy Audit".
	remove_submenu_page('wps_overview_page', 'wps_privacy-audit_page');
	//Hide "Statistics → Settings".
	remove_submenu_page('wps_overview_page', 'wps_settings_page');
	//Hide "Statistics → Optimization".
	remove_submenu_page('wps_overview_page', 'wps_optimization_page');
}

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

Where do I put this code?

How to Hide the "Daily Traffic Trend" Meta Box

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

	//Hide the "Daily Traffic Trend" meta box.
	remove_meta_box('wp-statistics-post-widget', $screen->id, 'normal');
}

add_action('add_meta_boxes', 'plt_hide_wp_statistics_metaboxes', 20);

How to Hide WP Statistics Dashboard Widgets

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

	//Remove the "Traffic Overview" widget.
	remove_meta_box('wp-statistics-quickstats-widget', 'dashboard', 'normal');
	//Remove the "Traffic Summary" widget.
	remove_meta_box('wp-statistics-summary-widget', 'dashboard', 'normal');
	//Remove the "Browser Usage" widget.
	remove_meta_box('wp-statistics-browsers-widget', 'dashboard', 'normal');
	//Remove the "Most Used Operating Systems" widget.
	remove_meta_box('wp-statistics-platforms-widget', 'dashboard', 'normal');
	//Remove the "Device Usage Breakdown" widget.
	remove_meta_box('wp-statistics-devices-widget', 'dashboard', 'normal');
	//Remove the "Top Device Models" widget.
	remove_meta_box('wp-statistics-models-widget', 'dashboard', 'normal');
	//Remove the "Top Referring" widget.
	remove_meta_box('wp-statistics-referring-widget', 'dashboard', 'normal');
	//Remove the "Daily Traffic Trend" widget.
	remove_meta_box('wp-statistics-hits-widget', 'dashboard', 'normal');
	//Remove the "Referrals from Search Engines" widget.
	remove_meta_box('wp-statistics-search-widget', 'dashboard', 'normal');
	//Remove the "Most Visited Pages" widget.
	remove_meta_box('wp-statistics-pages-widget', 'dashboard', 'normal');
	//Remove the "Most Active Visitors" widget.
	remove_meta_box('wp-statistics-top-visitors-widget', 'dashboard', 'normal');
	//Remove the "Latest Visitor Breakdown" widget.
	remove_meta_box('wp-statistics-recent-widget', 'dashboard', 'normal');
	//Remove the "Currently Online" widget.
	remove_meta_box('wp-statistics-useronline-widget', 'dashboard', 'normal');
}

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