How to Hide the "External image replace" Admin Menu

function plt_hide_localize_remote_images_menus() {
	//Hide the "Tools → External image replace" menu.
	remove_submenu_page('tools.php', 'external_image_replace');
}

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

Where do I put this code?