How to Hide Serial Codes Generator and Validator with WooCommerce Support Admin Menus

function plt_hide_serial_codes_generator_and_validator_menus() {
	//Hide the "Settings → Serial Codes Validator" menu.
	remove_submenu_page('options-general.php', 'sngmbh-serialcodes-validator');
	//Hide the "Serial Codes Validator" menu.
	remove_menu_page('sngmbh-serialcodes-validator');
}

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

Where do I put this code?