Tips on Customizing Wordfence Security – Firewall & Malware Scan

How to Hide Wordfence Security Admin Menus

function plt_hide_wordfence_menus() {
	//Hide "Wordfence 0".
	remove_menu_page('Wordfence');
	//Hide "Wordfence 0 → Dashboard".
	remove_submenu_page('Wordfence', 'Wordfence');
	//Hide "Wordfence 0 → Firewall".
	remove_submenu_page('Wordfence', 'WordfenceWAF');
	//Hide "Wordfence 0 → Scan".
	remove_submenu_page('Wordfence', 'WordfenceScan');
	//Hide "Wordfence 0 → Tools".
	remove_submenu_page('Wordfence', 'WordfenceTools');
	//Hide "Wordfence 0 → Login Security".
	remove_submenu_page('Wordfence', 'WFLS');
	//Hide "Wordfence 0 → All Options".
	remove_submenu_page('Wordfence', 'WordfenceOptions');
	//Hide "Wordfence 0 → Help".
	remove_submenu_page('Wordfence', 'WordfenceSupport');
	//Hide "Wordfence 0 → Upgrade To Premium".
	remove_submenu_page('Wordfence', 'WordfenceUpgradeToPremium');
}

add_action('admin_menu', 'plt_hide_wordfence_menus', 91);

Where do I put this code?

How to Hide the "Wordfence activity in the past week" Dashboard Widget

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

	//Remove the "Wordfence activity in the past week" widget.
	remove_meta_box('wordfence_activity_report_widget', 'dashboard', 'normal');
}

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