Creating relationships from posts to posts is a common question for WordPress developers. Previously, you can do that with the
post field type in Meta Box. But that’s not really the true solution, because you hardly create bi-directional relationships. Besides, querying by custom fields is not recommended.
So, we have created MB Relationships plugin that handle the relationships between posts, terms and users. It allows you to create not only posts to posts connections, but also posts to terms, posts to users and vice-versa. The plugin uses custom relationship database. So it’s very lightweight and optimized for query performance.
These are some screenshots from the plugin interface:
In a nutshell, the plugin helps you to:
- Create posts to posts, posts to terms, posts to users relationships with simple APIs.
- Query connected posts, terms, users using built-in WordPress API (
get_users). You can query items that connected to or from specific items. The query is optimized to make sure you make only 1 call to the database.
- Display connected items with shortcode
It’s worth noting that the plugin is inspired by the very popular plugin Posts 2 Posts, which is no longer maintained. The author “scribu” has left WordPress community. So, we take the idea and build MB Relationships. We also received some requests from our users, so we think this is something that people want.
If you need a lightweight solution to connect posts to posts, then take a look at MB Relationship. And let me know what you think in the comments!