How to Hide the "Random Post Inserter" Admin Menu

function plt_hide_random_post_inserter_menus() {
	//Hide the "Settings → Random Post Inserter" menu.
	remove_submenu_page('options-general.php', 'rpi-settings');
}

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

Where do I put this code?