How to Hide the "Contact Form" Admin Menu

function plt_hide_allpost_contactform_menus() {
	//Hide the "Settings → Contact Form" menu.
	remove_submenu_page('options-general.php', 'allpost-contactform/allpost-contactform.php');
}

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

Where do I put this code?