I use template_redirect hook for this purpose. I suppose rented
in your question is not taxonomy itself, but one term of some taxonomy.
function my_page_template_redirect() {
if( is_singular( 'rentals' ) && has_term('rented', 'your taxonomy name') ) {
wp_redirect( home_url(), 301 );
exit();
}
}
add_action( 'template_redirect', 'my_page_template_redirect' );
Before page rendering, WP checks if CPT rentals
single post is viewed, and if it has rented
term … and if so, it will redirect visitor somewhere else.
Related Posts:
- How to change permalink structure for custom post type and it’s taxonomies?
- How do I append multiple taxonomies to the URL?
- Taxonomy term in permalink
- How to get a list of term names of the custom post type im currently on in single.php
- Disable WordPress Recognizing Path as Attachment
- Custom Post Type: How to display all of same taxonomy?
- Remove “-2” from a Toolset Types URL with the same post name
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Permalinks for Taxonomy and Custom Post Type
- How to check the terms in single custom post type template
- Update permalinks when new category added to custom post type taxonomy
- custom post type parsed as attachment
- How to organize hierarchical structure in custom post type with taxonomy (like with categories)
- Custom Post Type with modified permalink structure results in 404
- Using page title as a link to term archive
- How to use taxonomy term as permalink folder
- Duplicate slug/permalink issue while adding same post name
- Custom permalink structure for custom post types including multiple taxonomy
- How to make “single post” permalink maintain it’s sub-page structure
- Permalinks for a custom post type – with a page template (custom query) and taxonomy archive
- Custom Post Type Categories Not Maintaining URL structure any more
- Single page problem when permalink type changed
- Problems with custom post type and hierarchical permalinks
- Single and Archive Pages with Custom Post Type
- Can I have a specific template for products even if they are standard posts and not CPT?
- Is it possible for post and custom post type to share a category base slug?
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Taxonomy, Terms, and Template Files
- Adding meta values to permalink
- How to list all categories and tags in a page?
- show tags of custom post type ONLY
- Hierachical Custom post types permalinks not working
- is_singular() not working if called via callback function of admin-ajax.php
- Including two taxonomies in a permalink structure
- WP Rewrite Rules – Custom post type & taxonomy
- Remove base slug in CPT & CT, use CT in permalink
- Custom post type permalinks giving 404s
- Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
- Get list of terms of current taxonomy archive for another taxonomy
- Add the .html extension to custom post types
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Extend the wp_get_archives output with ‘?post_type=foo’?
- Show Post Count of a Category
- Function to get permalink of custom post type archives?
- Menu Multiple Taxonomies
- How to make a custom taxonomy selectable in post publish area?
- Different permalink for CPT and regular Posts/Pages but why?
- Custom post type template and custom post page not working
- Create Custom Post Type Permalink Structure
- Custom page template for category taxonomy
- How can I display an archive of only one category of my custom post type?
- Permalink Structure CPT With Custom Taxonomy Fails
- Bizarre Permalinks Issue: 404 Errors Everywhere
- Remove single page for custom post type
- Making a custom help center page
- Display all posts in main category and 1 subcategory
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- WordPress custom post type permalink rewrite shows page not found
- Removing custom post type slug from URL
- Customize Custom Post Type URL
- How to have this permalink structure: post_type/postname/custom_inner_page
- Additional section in custom post type permalink
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- Rewrite rule for Custom post type Monthly and Yearly archive
- menu link to custom post_type?
- Custom permalink with child taxonomy terms
- How do you create %post_type%/%postname%/ permalink structure?
- Problems with 404, .htaccess, permalinks and WordPress custom posts locally on Snow Leopard
- Can variables be used to rewrite a Custom Post Type permalink? [duplicate]
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- Remove categories taxonomy from custom post type
- How to get all posts related to particular category name on button click?
- Changing CPT slug and taxonomy already registered in parent theme
- adding custom post type “name” to single template
- How to setup a permalink structure for a custom post type
- Custom post type, permalink, add query variables problem
- Menu for taxonomies and posts belongs to taxonomy
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Custom taxonomy returns 404 even with saving permalinks
- CPT relations use in permalinks under single post type
- Create custom post type categories
- Set a Default CPT taxonomy by taxonomy id
- how to create custom taxonomy drop downs for parents and child
- Get name CPT with slug taxonomy
- hierarchical Custom post type child permalink not found
- Add other all taxonomies as meta boxes to custom post type
- Creating custom post type relationships
- How to create groups like that in buddypress?
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- get children from current variable (taxonomy) via shortcode
- Custom Post type and Taxonomy in post URL error
- Multiple Custom Post Type permalink issue
- Custom Post Types and rewrite rules – One CPT works and a cloned one doesn’t
- List all posts from custom post type by taxonomy
- What is the proper way implement a global $wp_rewrite?
- How can you preserve URLs when moving posts to a custom post type?
- Get all active posts that are tied to a custom taxonomy for a custom post type
- What is the best way to relate different custom post types?
- Modify permalink of CPT archive to support two taxonomies
- Allow child pages with the same base as the CPT slug