How to Hide the "Autoptimize" Admin Menu

function plt_hide_autoptimize_menus() {
	//Hide the "Settings → Autoptimize" menu.
	remove_submenu_page('options-general.php', 'autoptimize');
}

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

Where do I put this code?