ok – so this isn’t what I wanted but it does the trick.
Adding a function to redirect when the user hits any term but one:
function my_page_template_redirect() {
if( is_singular( 'custom-post-type' ) && !(has_term('term', 'custom-taxonomy')) ) {
wp_redirect( home_url(), 301 );
exit();
}
}
add_action( 'template_redirect', 'my_page_template_redirect' );
Answer based on this one: Disable Single Post View for Specific Taxonomy on Custom Post Type
Related Posts:
- How to change permalink to include custom post type
- How to divide Subcategories into pages of parent category wordpress
- Check that a slug is present in the get_terms request
- Post Custom & Taxonomy 404 error
- How to get the proper category in permalink with custom post type assigned to multiple categories
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- Permalinks not working for custom taxonomy on custom post type
- Permalink Structure CPT With Custom Taxonomy Fails
- Parent & Child Taxonomy slugs in custom post permalink
- Insert HTML inside link in a walker
- Custom Post Types and independent Categories – complex Taxonomy
- Change Permalink Structure for Tag.php template
- Custom Taxonomy Permalinks Redirection
- Use different taxonomies in different custom post types’ permalinks?
- custom permalinks based on taxonomies for custom post type
- Remove standard meta boxes from custom taxonomy
- Custom template won’t load for a custom post type (custom permalinks used)
- Custom taxonomy in URL showing 404
- Am unable to reset a query properly
- Get next and previous 3 posts in a term in single post page
- Making certain categories of CPT not publicly queryable
- Custom Post Type permalink shows wrong page: homepage/index.php
- Search / Filter posts on Title/Content OR Tags
- Get parse_query filter to return slug instead of id
- How to hook custom taxonomies to custom post types and make the permalinks work?
- Custom post type url with category
- How do I move/order posts with a tag to the end?
- Adding custom post category slug in permalink causes 404 error for pages and posts
- How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- How to have the same url structure for both a CPT and a Taxonomy?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- custom-taxonomy/post_name instead of the default post_type/post_name
- Show custom post archive when custom post not specified
- Show custom post type relationships by taxonomy
- Query taxonomy of taxonomy of custom post type
- Can’t remove front from permalinks for custom taxonomy category page
- Removing custom post type slug from URL
- Customize Custom Post Type URL
- How to rewrite url for any specific taxonomy?
- Specific query for custom post type
- Permalinks /country/city/cpt/postname/
- Seamless permalinks between Custom Taxonomy and Custom Posts
- Custom post type and custom taxonomy with the same slug using the file page taxonomy only as directory
- Custom Permalinks with CPT and Hierarchical Taxonomies
- How to have this permalink structure: post_type/postname/custom_inner_page
- Display post content with respect to its title?
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Custom taxonomy returns 404
- First custom field value (out of several) displayed twice after query
- Permalinks: custom post type -> custom taxonomy -> post
- CPT’s with landing page instead of archive – Url Rewrite?
- Custom post type, permalinks, taxonomies and blog posts
- Custom post type permalink tag 404
- WP_Query orderby and tax_query
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- permalink /category/post-name with custom post type and taxonomy
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Custom post type and taxonomy permalinks
- Hierarchical permalinks for custom post type and taxonomy
- Add term to custom post type on draft
- set permalink for CPT
- Custom permalink with child taxonomy terms
- Custom post type Permalinks with hierarchical Taxonomies
- Different Category system needed for the Custom Post Type
- How to solve this custom post type goes to 404 page?
- Best way to specify “article type” in URL
- Template files for Custom Post Type and Taxonomy
- How to query 2 custom post types that need to share a slug?
- Can’t use pagination with custom taxonomy
- WP_Query() with custom post type and taxonomy — get all terms?
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- Pretty Permalinks with CTP and Taxonomies / Hierarchical
- Customise Permalink Structure For Custom Post Types
- Change Search display for Custom Post Type
- How to change URL structure for custom post type in wordpress? Custom taxonomy + custom Post name [duplicate]
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- Recovering data about custom post and taxonomy types
- % encoded URL giving 404 error in WordPress
- Remove CPT Slug with 2 taxonomies and 1 post meta
- Custom post type and taxonomy same slug
- wordpress does not see the correct custom taxonomy hierarchy
- How to create a permalink structure with custom taxonomies and custom post types
- How to structure a website with custom post types and custom taxonomies?
- Issue with Custom Post Types and Permalinks
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Pagination not working (page/2 retunring 404 page)
- WordPress page not showing up – replaced with last 10 posts?
- Custom permalink rewrite rules – how do I fix this?
- Custom permalink with custom taxonomies for custom post type
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- Pretty permalink structure with multiple (AND OR) taxonomies
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Change the url of a custom post type to include taxonomy
- Get posts of an specific term of a custom taxonomy
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Custom Post Type Taxonomy – Permalinks generating, but posts not found
- How to have permalink structure based on taxonomy terms
- Create 2-layered dropdown menus for custom taxonomy and custom post type