How to Hide Imagify Admin Menus

function plt_hide_imagify_menus() {
	//Hide the "Settings → Imagify" menu.
	remove_submenu_page('options-general.php', 'imagify');

	//Hide the "Media → Bulk Optimization" menu.
	remove_submenu_page('upload.php', 'imagify-bulk-optimization');
	//Hide the "Media → Other Media" menu.
	remove_submenu_page('upload.php', 'imagify-files');
}

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

Where do I put this code?