{"id":20514740,"url":"https://github.com/wpmetabox/mb-relationships","last_synced_at":"2025-04-07T11:07:58.017Z","repository":{"id":28868363,"uuid":"119465769","full_name":"wpmetabox/mb-relationships","owner":"wpmetabox","description":"A lightweight WordPress plugin for creating many-to-many relationships between posts, terms and users.","archived":false,"fork":false,"pushed_at":"2025-02-14T16:05:19.000Z","size":302,"stargazers_count":29,"open_issues_count":8,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-31T10:03:53.483Z","etag":null,"topics":["meta-box","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://metabox.io/plugins/mb-relationships/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wpmetabox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-30T01:38:05.000Z","updated_at":"2025-02-14T16:05:00.000Z","dependencies_parsed_at":"2023-11-16T08:28:00.797Z","dependency_job_id":"a087a9c8-5f24-4f17-9a69-6d49e109606c","html_url":"https://github.com/wpmetabox/mb-relationships","commit_stats":{"total_commits":205,"total_committers":15,"mean_commits":"13.666666666666666","dds":"0.37073170731707317","last_synced_commit":"15fe30899704b3c0a71aa0bf98e1c14d5ac48ffc"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpmetabox%2Fmb-relationships","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpmetabox%2Fmb-relationships/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpmetabox%2Fmb-relationships/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpmetabox%2Fmb-relationships/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpmetabox","download_url":"https://codeload.github.com/wpmetabox/mb-relationships/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640463,"owners_count":20971557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["meta-box","wordpress","wordpress-plugin"],"created_at":"2024-11-15T21:17:58.627Z","updated_at":"2025-04-07T11:07:57.982Z","avatar_url":"https://github.com/wpmetabox.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"**MB Relationships** helps you create many-to-many relationships between posts, pages or any custom post type. The plugin is lightweight and optimized for database and query performance.\n\nThe plugin allows you to create connections from posts to posts, posts to pages and so on. Then you can perform corresponding queries to retrieve posts that are connected to or from given posts.\n\n\u003e **Meta Box Lite**\u003cbr\u003e\n\u003e We recommend using [Meta Box Lite](https://metabox.io/lite/), a feature-rich free UI version of Meta Box that provides UI and all free features for managing custom fields and dynamic content on WordPress, including post types, taxonomies, custom fields, and relationships.\n\nIt supports reciprocal and bi-directional relationships.\n\n### Why Do You Need Posts To Posts Relationships In WordPress?\n\nPost relationships is a missing part in WordPress. The only \"built-in\" way that mimic the post relationship in WordPress is the `post_parent` for pages where you can create many child pages of a page (a one-to-many relationship). Unfortunately, that's available for pages and hierarchical post types only. Besides, it's not many-to-many relationship.\n\nBelow are some examples of posts to posts relationships that might help you see the benefit of this feature:\n\n#### Creating Related Posts In WordPress\n\nThe simplest example is to manually create related posts in your WordPress website. When you edit a post, you can select posts that have similar or related content and display them in the frontend for further reading.\n\nYou can also query backward: displaying posts that link to the being read post as a reference to provide more information to your readers. With this, you don't need a WordPress related posts plugin anymore.\n\n#### Example: Events And Bands\n\nSuppose you have two custom post types, event and band, where:\n\n- In each event there may be multiple bands, and\n- Each band can participate in many events.\n\nIf people want to buy tickets, they could search for events in their location and see what bands are playing on a given date, or they could search for bands they like and see what date they are playing near their location.\n\nIn this example, we have created many-to-many relationships between events and bands.\n\n### Bi-directional relationships\n\n**MB Relationships** allows you to create bi-directional connections. You will be able to query back and forth without any problem.\n\nThe data is stored in the database as a pair of (from_id, to_id), thus making it independent from either side.\n\nBesides, for each side, there's a meta box that shows what are connected from/to. So you don't have to worry about the direction of the connection anymore.\n\n### An Alternative For The Posts 2 Posts Plugin (P2P Plugin)\n\n**MB Relationships** is very much inspired by the popular plugin [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/) which is not maintained anymore. We have taken the idea and made some improvements. The codebase and data structure is very similar.\n\n## Plugin features\n\n- **Simple APIs**: the plugin provides simple APIs for registering relationships and retrieving connected items. It integrates with existing WordPress APIs such as `WP_Query`,` get_terms` and `get_users`. See [documentation](https://docs.metabox.io/extensions/mb-relationships/) for more information.\n- **REST API**: the plugin provides a REST API to manage relationships programatically. See [documentation](https://docs.metabox.io/extensions/mb-relationships/#rest-api) for more information.\n- Uses **custom relationship table** to store relationships. That helps optimize the database storage and query performance.\n- You can **create relationships between any kind of content** in WordPress: posts to posts, posts to users, etc. For posts to terms and posts to users, it's required the [MB Term Meta](https://metabox.io/plugins/mb-term-meta/) and [MB User Meta](https://metabox.io/plugins/mb-user-meta/).\n- Supports creating **reciprocal relationships** (posts-posts, users-users, ...).\n- Supports creating **bi-directional relationships** and easily query them.\n- Display connected items easily with **shortcode**.\n- Extremely **lightweight and fast**.\n\n## Plugin Links\n\n- [Project Page](https://metabox.io/plugins/mb-relationships/)\n- [Github Repo](https://github.com/wpmetabox/mb-relationships/)\n\nThis plugin is a free extension of [Meta Box](https://metabox.io) plugin, which is a powerful, professional solution to create custom fields and custom meta boxes for WordPress websites. Using **MB Relationships** in combination with [other extensions](https://metabox.io/plugins/) will help you manage any content types in WordPress easily and make your website more professional.\n\n## You might also like\n\nIf you like this plugin, you might also like our other WordPress products:\n\n- [Meta Box](https://metabox.io) - The most powerful WordPress plugin for creating custom post types and custom fields.\n- [Slim SEO](https://wpslimseo.com) - A fast, lightweight and full-featured SEO plugin for WordPress with minimal configuration.\n- [Slim SEO Schema](https://wpslimseo.com/products/slim-seo-schema/) - An advanced, powerful and flexible plugin to add schemas to WordPress.\n- [Slim SEO Link Manager](https://wpslimseo.com/products/slim-seo-link-manager/) - Build internal link easier in WordPress with real-time reports.\n- [GretaThemes](https://gretathemes.com) - Free and premium WordPress themes that clean, simple and just work.\n- [Auto Listings](https://wpautolistings.com) - A car sale and dealership plugin for WordPress\n\n## Installation\n\nYou need to install [Meta Box](https://metabox.io) plugin first\n\n- Go to Plugins | Add New and search for Meta Box\n- Click **Install Now** button to install the plugin\n- After installing, click **Activate Plugin** to activate the plugin\n\nInstall **MB Relationships** extension\n\n- Go to **Plugins | Add New** and search for **MB Relationships**\n- Click **Install Now** button to install the plugin\n- After installing, click **Activate Plugin** to activate the plugin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpmetabox%2Fmb-relationships","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpmetabox%2Fmb-relationships","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpmetabox%2Fmb-relationships/lists"}