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 → PostTypes Permalinks".
	remove_submenu_page('cp-post-permalinks', 'cp-post-permalinks');
	//Hide "Custom Permalinks → Category Permalinks".
	remove_submenu_page('cp-post-permalinks', 'cp-category-permalinks');
	//Hide "Custom Permalinks → About CP".
	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 "Permalink" Meta Box

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

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

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