s_ha_dum’s answer didn’t work for me, but this did:
/**
* Completely disable term archives for this taxonomy.
* @param string $taxonomy WordPress taxnomy name
*/
function kill_taxonomy_archive($taxonomy){
add_action('pre_get_posts', function($qry) {
if (is_admin()) return;
if (is_tax($taxonomy)){
$qry->set_404();
}
}
);
}
Related Posts:
- What is the best practice for displaying my plugin content in themes?
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- WordPress add taxonomies/terms list as a menu in archive page
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- How to make a custom taxonomy selectable in post publish area?
- Problem with custom post types, taxonomy and permalinks
- How to create new category for custom post type?
- Fetch taxonomies by custom post type id array
- How to check the terms in single custom post type template
- get_terms showing all categories instead of the ones assigned to a specific post
- How can I move a custom taxonomy and its data from one post type to another?
- Custom page template for category taxonomy
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- Metadata for a taxonomy – is there any WordPress way of doing this?
- Query Multiple Taxominies Across Multiple Post type’s
- How do I get array of types associated with a taxonomy?
- wp_set_object_terms() not adding new term to custom post and custom taxonomy
- get_object_taxonomies() returns empty array for custom post type
- Display all posts in main category and 1 subcategory
- wp_get_post_terms on custom post type with custom taxonomies returning an empty array
- Adding a custom post type taxonomy template in plugin
- How to add a custom taxonomy to show up in a custom post type menu?
- Custom Taxonomies not appearing in Admin
- Custom Post Type Taxonomy Filters
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- Custom Taxonomy back-end customizations
- Taxonomy custom post type URL
- How to Filter custom post type by taxonomy?
- Is it possible to have dedicated page for parent/child taxonomy?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Get related posts of child term of custom post type
- Limit amount of posts made within a custom taxonomy
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- list taxonomies from a custom post type
- Display a grid of taxonomy terms at root taxonomy page
- limit value taxonomy based on previous taxonomy value wordpress
- How do I display the taxonomy for a custom post type in an array
- Set a CPT slug as a base name for all the taxonomies
- How to conditionally redirect to the post from a taxonomy page?
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- How do I display the grand child items of a taxonomy term?
- Taxonomies relations
- Is it better to use WordPress Custom Post Types or Taxonomies?
- Full Custom Post Type List Organised by two Taxonomies
- WordPress Doesn’t Generate Taxonomy Archive
- Suggested Post and Taxonomy structure
- Custom post with more than one custom taxonomy
- Get the taxonomy of a post hierarchically
- Adding custom taxonomy in same menu place with two custom post types
- How to make custom taxonomy into drop down select in a custom metabox
- How to get list of taxonomy slugs ordered parents>childs?
- Deleting taxonomy terms and relationships on a custom post_type when a user is deleted
- How do I share categories across multiple post types?
- Migrating a taxonomy’s tags to the native category
- Multiple tag cloud filtering
- Get url.com/post_type/taxonomy/term work!
- Plugin fatal error
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Taxonomy in URL
- Different Category system needed for the Custom Post Type
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- How to Set Taxonomy Object Description?
- Custom select query for taxonomies that have posts categorized in another taxonomy
- Custom post type’s extra fields – how to handle?
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- Rename a slug label
- Main query not querying any posts in custom taxonomy template
- Custom taxonomy returns 404 even with saving permalinks
- Create custom post type categories
- How to add CSS class field in Custom Taxonomy?
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Taxonomies are not showing in the category dropdown
- Change custom post taxonomy values from front-end
- Display 3 level taxonomies
- Set a Default CPT taxonomy by taxonomy id
- Get all posts for custom taxonomy term
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- List posts that have the current url taxonomy
- Listing all custom posts having a specific taxonomy whatever the terms
- List all posts associated under custom taxonomy
- How to transfer categories (default) to custom taxonomy?
- How to manage a dynamic multi-level page hierearchy system?
- Insert custom taxonomy into category query
- Custom Taxonomy – fields
- Display custom tax in “while” loop
- % encoded URL giving 404 error in WordPress
- Categories manage
- Add other all taxonomies as meta boxes to custom post type
- How to get post type archive category title
- Pages of my taxonomy terms are showing all posts
- tax_query not working?
- I can not call the categories of custom post type
- Custom post type category link + add to menu
- Showing taxonomies with terms that are attached to custom post
- Which File Populating CPTs in Slug URL
- If custom taxonomy exist on post?