How to Hide Nested Pages Admin Menus

function plt_hide_wp_nested_pages_menus() {
	//Hide "Settings → Nested Pages".
	remove_submenu_page('options-general.php', 'nested-pages-settings');

	//Hide "Pages".
	remove_menu_page('nestedpages');
	//Hide "Pages → All Pages".
	remove_submenu_page('nestedpages', 'admin.php?page=nestedpages');
	//Hide "Pages → Add New Page".
	remove_submenu_page('nestedpages', 'post-new.php?post_type=page');
	//Hide "Pages → Default Pages".
	remove_submenu_page('nestedpages', 'edit.php?post_type=page');
}

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

Where do I put this code?