Title: Search include relationships
Last modified: August 20, 2016

---

# Search include relationships

 *  [aaron@rossano.com.au](https://wordpress.org/support/users/aaronrossanocomau/)
 * (@aaronrossanocomau)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/search-include-relationships/)
 * Hi, does the built in WP function search through relationships?
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

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

 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/search-include-relationships/#post-3224628)
 * Not sure what you mean. A relationship is just a bunch of numeric ids and a type.
   What would you search on?
 *  Thread Starter [aaron@rossano.com.au](https://wordpress.org/support/users/aaronrossanocomau/)
 * (@aaronrossanocomau)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/search-include-relationships/#post-3224631)
 * Hi, thanks for responding.
    I mean if I have a custom post type ‘person’ and 
   it’s related to custom post type ‘company’. Then searching through custom post
   type ‘person’ would bring back results if the keyword matches in the related 
   company. I could do it manually by allowing multiple custom post types and then
   for every result that is not a person, I check it’s relationship. But that would
   be extra work, thought maybe that could be automated as that would probably be
   useful functionality.
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/search-include-relationships/#post-3224639)
 * That can get messy pretty fast. You’ll have to implement this functionality yourself,
   using the ‘posts_search’ filter.

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

The topic ‘Search include relationships’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-to-posts_7a8e9d.svg)
 * [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-to-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-to-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-to-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-to-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-to-posts/reviews/)

## Tags

 * [posts2posts](https://wordpress.org/support/topic-tag/posts2posts/)
 * [Relationship](https://wordpress.org/support/topic-tag/relationship/)

 * 3 replies
 * 2 participants
 * Last reply from: [scribu](https://wordpress.org/support/users/scribu/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/search-include-relationships/#post-3224639)
 * Status: not resolved