You can use the wp_robots filter to manipulate the robots meta tag as needed. And as you’re checking against a taxonomy term you can use the has_term() helper conditional to make your code look a litte nicer. (A post can be passed to has_term()
as the 3rd parameter, but if it is not passed then the function checks against the current post.)
add_filter(
'wp_robots',
function(array $robots) {
if ( has_term('enviso_group_ticket', 'product_type') ) {
return array_merge(
$robots,
array(
'noindex' => true,
'nofollow' => true,
)
);
} else {
return $robots;
}
}
);
Related Posts:
- Category title output before opening title tag
- WordPress custom taxonomy description for each post?
- Current post’s author name in the author meta tag
- How to find objects by terms
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Display certain amount of posts on taxonomy archive page
- I want to remove the links from the term list returned by get_the_term_list
- How do I get taxonomy terms by ID in a specific order
- PHP Customization: Taxonomies and Queries, why? [closed]
- Display Post co-authored in Author Page
- A Specific Blog post to be assigned as the landing page of my wordpress blog
- Make first letter of my taxonomy uppercase
- conditional statement for custom taxonomy
- Can I change the contents of a description meta tag generated by Yoast?
- Get taxonomy terms only of the WP_Query current posts
- Rename “Portfolio” slug?
- Custom page archive query by url var calling page twice on one of my custom queries?
- Taxonomy linked to pages
- Create a hierarchical taxonomy list in WordPress
- get_the_tags() not iterating through for/while loop, but will with foreach
- A solution to set metatags with my page generating plugin?
- WordPress plugin for nicer looking slugs? Have multiple pages named the same but they get different slugs
- Customising the search function?
- Getting error when trying to implement site-wide breadcrumbs in Twentytwentyone Theme [closed]
- Loop through categories and display posts title under each dropdown
- How to remove role=”navigation” from all nav elements?
- Change title only in dynamic page
- Displaying Hierarchical custom taxonomy
- Get term siblings of current child taxonomy
- How to get post’s current parent term ID?
- Adding Taxonomy Image to taxonomy loop [closed]
- register_taxonomy() take much queries
- Way to bulk make all my tags lowercase?
- List taxonomy term slugs within shortcode (do_shortcode)
- Copy taxonomy terms from one post to another programmatically
- Hide image if taxonomy term is empty
- Isotope Drop Down Categories Filter Function
- How to filter custom taxonomy term name, slug, and description?
- Hierarchical taxonomy list with modificated term links
- Add class to website based on post taxonomy
- Seo Friendly Filter URLs
- How to add no follow to specific links?
- WordPress yoast seo plugin – parse snippet var in meta description
- Show the section only if custom taxonomy was chosen
- Exclude product attributes from taxonomy terms loop
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Change header on pages displaying taxonomy items
- .html end of URl affected to SEO?
- Can’t change website Title on wordpress
- WordPress site with embedded menu – gives You don’t have permission to access /wp-content/themes/xxx/taxonomy-redirect.php on this server
- Nginx WordPress and another Web app URL structure
- Genesis / custom template page / setting the page title and meta desc
- Taxonomy term count
- Get All In One SEO Pack to use custom field instead of Content
- How to get all the items of a taxonomy even if it does not have a custom post type?
- Filter unique custom field value based on custom taxonomy category or other custom field
- Trying to display terms from custom taxonomy within function
- Create a slug for a page in WordPress
- WordPress Conditional / Multiple Taxonomy Query
- Hi need update in my terms for other taxonomy
- Workaround for og:image unsupported webp image type, Yoast SEO?
- How to change the author box selection on a post to a custom taxonomy
- WordPress: Export/Import Yoast meta title & description to custom taxonomy
- Obfuscate links (for SEO purpose) [closed]
- Custom URL for multiple categories hierarchy
- Show related products by attribute based and certain conditions
- Display acf taxonomy attachment
- How to hide a child category and show his parent category
- How do I edit the terms output args or array data?
- 404 on old link after changing post url
- Tag title not being returned in page title of tag archives
- Retrieve alt text by referencing the img src
- update_term_meta() only updating once on certain meta keys
- ACF Taxonomy field values not select in backend
- Multiple Tag Filtering
- Yoast Breadcrumbs Inject Multiple Levels
- ACF – Can’t get custom post type by taxonomy
- Search for single post by 2 tags
- WordPress search query, how to modify the sql
- Permalink like example.com/taxonomy/post_type/postname
- Displaying child taxonomy before parent
- Add missing alt tag to featured images for “storefront” theme
- New term taxonomy and description in front page. Input’s
- How to associate dynamic PHP page for chosen WordPress tag?
- How to hide the Duplicate taxonomy values in WordPress?
- Display product attributes for current product
- How to display terms from two taxonomies in one php code?
- Custom Taxonomy as Link
- Redirect homepage /page/1/ to /blog/page/1/
- Change taxonomy for categories
- Select All not working in a WordPress search filter
- Get all the contents of taxonomy and sort by term
- Magento and WordPress URL integration [closed]
- Query specific posts per user selections from dropdown menus
- ISOTOPE – Missing/Invalid Arguement Get Terms
- wordpress taxonomy in regular posts
- category & sub category order issues in wordpress
- Wrapping the_content() in Schema articleBody tag? [closed]
- Is there a way of displaying related posts from lowest hyrachical order (lowest child category to parent category)
- Custom taxonomy with page post type – WordPress