Title: Exclude custom post from robots function
Last modified: November 28, 2016

---

# Exclude custom post from robots function

 *  Resolved [rtenny](https://wordpress.org/support/users/rtenny/)
 * (@rtenny)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/exclude-custom-post-from-robots-function/)
 * I have a plugin that handle property listings as custom post type.
    The robots
   meta gets handle by this plugin and I would like to exclude this post type from
   the YOAST robots function as I now have 2 conflicting robots meta tags.
 * Can this be done? I have already changed the core files but after each update
   that change would get lost.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Saša](https://wordpress.org/support/users/stodorovic/)
 * (@stodorovic)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/exclude-custom-post-from-robots-function/#post-8490190)
 * Maybe I can help you (I made something similar). You can use filter wpseo_robots:
 *     ```
       if ( class_exists('WPSEO_Frontend') ) {
             // Yoast SEO is active - add filter wpseo_robots
   
             add_filter( 'wpseo_robots', 'my_robots_func' );
             ....
       } else {
             // use other function
       }
   
       function my_robots_func( $robotsstr ) {
       	if ( is_singular( 'blabla' ) {
       		return 'noindex,follow';		
       	}
       	return $robotsstr;
       }
       ```
   
 * I’m not sure that you want it or something else. Also, you have option in SEO
   dashboard to exclude some post_types. You can post more details on [https://github.com/Yoast/wordpress-seo/issues](https://github.com/Yoast/wordpress-seo/issues)
   and I’ll try to help you
 *  Thread Starter [rtenny](https://wordpress.org/support/users/rtenny/)
 * (@rtenny)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/exclude-custom-post-from-robots-function/#post-8492253)
 * Great, thx very much, Thats is just what I needed
 *  [Adebowale Adekoya](https://wordpress.org/support/users/adebo4all/)
 * (@adebo4all)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/exclude-custom-post-from-robots-function/#post-9223678)
 * You saved me a whole day of work. **Thank you a million!**

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Exclude custom post from robots function’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

## Tags

 * [Yoast](https://wordpress.org/support/topic-tag/yoast/)

 * 3 replies
 * 3 participants
 * Last reply from: [Adebowale Adekoya](https://wordpress.org/support/users/adebo4all/)
 * Last activity: [8 years, 12 months ago](https://wordpress.org/support/topic/exclude-custom-post-from-robots-function/#post-9223678)
 * Status: resolved