Skip to content

The Missing Relationship Engine for WordPress

Structured, indexed, scalable relationships between posts, users, and terms.

php
ncr_add_relation( 123, 'post', 456, 'post', 'related_to' );
$related = ncr_get_related( 123, 'post', 'related_to', [ 'limit' => 10 ] );

Stability promise

Schema stable from 1.x onward. Backward compatibility guaranteed.

Pick your path ​


The problem ​

WordPress does not have native relationships.

  • Post meta is unindexed β€” meta_query on relationship-style keys doesn't scale; full table scans as data grows.
  • Taxonomies are semantic grouping, not relational modeling β€” Categories and tags group posts; they don't model β€œpost A links to post B” or directional graphs.
  • Meta queries degrade with scale β€” Complex relationship logic in meta becomes slow and hard to maintain.
  • Complex modeling becomes messy β€” Workarounds (custom tables, multiple meta keys, P2P-style plugins) add technical debt.

Developers need a first-class, indexed relationship layer. Not a workaround.


The solution ​

A dedicated relationship table and a small API. Same data, every surface.

Post β†’ Indexed relationship table β†’ Post / User / Term

  • Dedicated relational storage β€” One table, proper indexes. No post meta or taxonomy hacks.
  • Directional relationships β€” From/to, bidirectional or one-way. Model coursesβ†’lessons, favorites, parent/child.
  • WP_Query integration β€” Query by relationship in the loop. content_relation in your query args.
  • REST & CLI ready β€” Optional REST embed; WP-CLI commands for scripting and migration.
  • Multilingual safe β€” Works with WPML, Polylang. Relation IDs are stable across languages.

One API, one schema, many surfaces (PHP, REST, shortcodes, Gutenberg, Elementor).


Real-world use cases ​

Don’t list features. Show patterns.

Content modeling

  • Courses β†’ Lessons
  • Products β†’ Accessories
  • Articles β†’ Related content

User relationships

  • Favorites, bookmarks
  • Multi-author posts

Taxonomy extensions

  • Featured categories
  • Curated collections

β†’ Use cases β€” Products, courses, related articles, favorites, with code and shortcodes.


Performance & benchmarks ​

Most WP plugins never show performance data. We do.

Scenario100k relations1M relations
Point lookup (mean)0.49 ms1.00 ms
Point lookup (P95)0.85 ms2.73 ms
Covering index mean0.22 ms0.61 ms
Peak memory deltaβ€”~2.21 MB

Covering index: (type, from_id, to_id) β€” index-only lookups; query time O(log n). Sub-2ms typical at 1M rows.

β†’ Benchmarks β€” Full methodology, scaling guide, and comparison with meta-based approaches.


Integrations ​


Architecture & stability promise ​

Critical for ecosystem and agency adoption.

Schema stability guaranteeStable from 1.x onward. No breaking schema changes in the 1.x line.
Backward compatibility commitmentPublic API and table structure remain compatible; new features are additive.
Semantic versioningVersion numbers reflect compatibility expectations.

β†’ Architecture overview Β· Schema


Developer section ​

Short and scannable.

β†’ Quick Start β€” First relationship in minutes.
β†’ Relationships β€” Create, query, remove from code.


Migration ​


Community & roadmap ​

Repository β€” GitHub β€” WP-Native-Content-Relationships

Contributing β€” How to contribute: issues, docs, code. Standards and hooks documented.

Roadmap β€” Near term & future: documentation, stability, integrations; WPGraphQL, tutorials, ecosystem.

Transparency builds trust. No fluff.

Schema stable from 1.x onward. Backward compatibility guaranteed.