Tips on Customizing Custom Permalinks

How to Hide Custom Permalinks Admin Menus

function plt_hide_custom_permalinks_menus() {
	//Hide "Custom Permalinks".
	remove_menu_page('cp-post-permalinks');
	//Hide "Custom Permalinks → Post Types Permalinks".
	remove_submenu_page('cp-post-permalinks', 'cp-post-permalinks');
	//Hide "Custom Permalinks → Taxonomies Permalinks".
	remove_submenu_page('cp-post-permalinks', 'cp-taxonomy-permalinks');
	//Hide "Custom Permalinks → About".
	remove_submenu_page('cp-post-permalinks', 'cp-about-plugins');
}

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

Where do I put this code?

How to Hide the "Custom Permalinks" Meta Box

function plt_hide_custom_permalinks_metaboxes() {
	$screen = get_current_screen();
	if ( !$screen ) {
		return;
	}

	//Hide the "Custom Permalinks" meta box.
	remove_meta_box('custom-permalinks-edit-box', $screen->id, 'normal');
}

add_action('add_meta_boxes', 'plt_hide_custom_permalinks_metaboxes', 20);