How to Hide Defender Admin Menus

function plt_hide_defender_security_menus() {
	//Hide "Tools → Scheduled Actions".
	remove_submenu_page('tools.php', 'action-scheduler');

	//Hide "Defender".
	remove_menu_page('wp-defender');
	//Hide "Defender → Defender".
	remove_submenu_page('wp-defender', 'wp-defender');
	//Hide "Defender → Recommendations".
	remove_submenu_page('wp-defender', 'wdf-hardener');
	//Hide "Defender → Malware Scanning".
	remove_submenu_page('wp-defender', 'wdf-scan');
	//Hide "Defender → Audit Logging".
	remove_submenu_page('wp-defender', 'wdf-logging');
	//Hide "Defender → Firewall".
	remove_submenu_page('wp-defender', 'wdf-ip-lockout');
	//Hide "Defender → WAF".
	remove_submenu_page('wp-defender', 'wdf-waf');
	//Hide "Defender → 2FA".
	remove_submenu_page('wp-defender', 'wdf-2fa');
	//Hide "Defender → Tools".
	remove_submenu_page('wp-defender', 'wdf-advanced-tools');
	//Hide "Defender → Notifications".
	remove_submenu_page('wp-defender', 'wdf-notification');
	//Hide "Defender → Settings".
	remove_submenu_page('wp-defender', 'wdf-setting');
	//Hide "Defender → Tutorials".
	remove_submenu_page('wp-defender', 'wdf-tutorial');
	//Hide "Defender → Upgrade For 80% Off!".
	remove_submenu_page('wp-defender', 'https://wpmudev.com/project/wp-defender/?utm_source=defender&utm_medium=plugin&utm_campaign=defender_submenu_upsell');
}

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

Where do I put this code?