[WordPress] 外掛分享: Native Content Relationships

WordPress 外掛 Native Content Relationships 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Native Content Relationships」是 2026-02-02 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2026-02-21,距離現在已有 5 天。
  • 外掛最低要求 WordPress 5.0 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

chetanupare |

外掛標籤

posts | terms | users | content | relationships |

內容簡介

### 總結文案:
WordPress並未提供原生方法來模擬文章、使用者和術語等內容項目之間的真實關係。許多解決方案依賴文章元資料或分類法,隨著時間推移變得難以查詢、擴展和維護。而Native Content Relationships外掛為WordPress引入了結構化的關係層,使您能夠定義有意義、可查詢且可擴展的內容之間的關係,而無需依賴駭客或特定於編輯器的解決方案。這款外掛旨在友好核心、專注開發人員並具未來保證。

### 問題與答案:
1. 這個外掛解決了什麼問題?
- 可以建立多對多之間的內容關係
- 無需使用文章元資料或分類法的情況下進行清晰的查詢
- 長期可維護性和可移植性
- 支援現代和無頭式WordPress設置

2. 該外掛的主要特點有哪些?
- 可以建立文章、使用者和術語之間的關係
- 支持單向或雙向關係
- 具有用於快速查詢的索引式資料庫表
- 提供乾淨的PHP API來管理關係
- 整合了WP_Query
- 支持REST API
- 支援多語言(WPML / Polylang)
- 可選整合WooCommerce
- 不依賴於編輯器和主題

3. 這個外掛支援的關係類型有哪些?
- 文章 ↔ 文章
- 文章 ↔ 使用者
- 文章 ↔ 術語
- 使用者 ↔ 文章
- 術語 ↔ 文章

4. 請舉例這個外掛的常見使用情境?
- 文章:產品 → 附件、課程 → 課程、文章 → 相關內容
- 使用者:喜愛的文章、書籤內容、多位作者或貢獻者
- 術語:特色分類、精選系列、超越預設分類法的語義分組

5. 可以使用這個外掛進行什麼管理工作?
- 在文章編輯器中管理關係
- 使用者個人檔案關係管理
- 支援術語編輯器中的關係
- AJAX驅動的文章、使用者和術語搜索
- 現代UI與WordPress管理樣式相匹配

6. 這個外掛支援對性能和架構的要求是什麼?
- 有專用的索引式資料庫表
- 不使用文章元資料或分類法的駭客
- 適用於大型和多語言網站的最佳化
- 具有快取友好性和可在共享主機上執行的特性
- 設計用於大型數據集的擴展

7. 有哪些整合方案可以應用於這個外掛?
- WooCommerce(產品關係)
- WPML / Polylang(關係鏡像)

原文外掛簡介

WordPress does not provide a native way to model real relationships between content items such as posts, users, and terms.
Most solutions rely on post meta or taxonomies, which become difficult to query, scale, and maintain over time.
If you’ve outgrown ACF relationship fields or post meta arrays, Native Content Relationships introduces a structured relationship layer for WordPress that allows you to define meaningful, queryable, and scalable relationships between content — without relying on hacks or editor-specific solutions.
This plugin is designed to be core-friendly, developer-focused, and future-proof, built specifically for developers who have hit performance walls.
What This Plugin Solves
• Many-to-many relationships between content
• Clean querying without meta or taxonomy abuse
• Long-term maintainability and portability
• Cleanly handles headless and REST WordPress setups
Key Features
• Relationships between posts, users, and terms
• One-way or bidirectional relationships
• Indexed database table for fast queries
• Clean PHP API for managing relationships
• WP_Query integration
• REST API support with inline relations
• Multilingual-ready (WPML / Polylang)
• WooCommerce optional integration
• Editor- and theme-agnostic
Supported Relationship Types
• Post ↔ Post
• Post ↔ User
• Post ↔ Term
• User ↔ Post
• Term ↔ Post
Common Use Cases
Posts
• Products → Accessories
• Courses → Lessons
• Articles → Related content
Users
• Favorite posts
• Bookmarked content
• Multiple authors or contributors
Terms
• Featured categories
• Curated collections
• Semantic grouping beyond default taxonomies
Admin Interface
• Relationship management in post editor
• User profile relationship management
• Term editor relationship support
• AJAX-powered search for posts, users, and terms
• Modern UI matching WordPress admin style
Stability & Backward Compatibility
Schema stable from 1.x onward. Backward compatibility guaranteed.
We lock the core before expanding. Ecosystem and agency confidence depend on it.

Database schema stability — The relationship table and NCR_SCHEMA_VERSION are stable in the 1.x line. Any future schema change will be additive (new columns/indexes) or run through a documented migration; no breaking table or column renames without a major version.
Backward compatibility promise — Public PHP APIs (functions, hooks, WP_Query arguments), shortcodes, and REST endpoints will not be removed or changed in breaking ways within the 1.x branch. Deprecations will be announced and supported for at least one minor version.
Versioning policy — 1.x = stable core. Minor/patch releases may add features and fix bugs; they will not break existing integrations. A major version (2.x) would be the only place for intentional breaking changes, with a clear migration path.
Namespacing discipline — One internal prefix: ncr_ (functions, hooks, options), NCR_ (classes, constants), ncr- (CSS/IDs/handles). No new alternate prefixes; documented and consistent so extensions and ecosystem plugins can rely on a stable surface.

Architected for Performance & Scale
Native Content Relationships is built for high-volume enterprise and headless WordPress sites. Forget the performance bottleneck of post-meta.

Index Optimization: Built on composite covering indexes (type_lookup) and a smart query planner optimized for performance.
Micro-Optimized Validations: SQL-native validations ensure sub-2ms P95 latency even at 1M+ rows.
Object Cache Integration: Full compatibility with object cache through group isolation, targeted relationship cache invalidation, and bulk priming strategies.
Performance Diagnostics: Includes a powerful CLI diagnostic utility to check and fix integrity without UI bloat.

Benchmarks confirm stable performance with 1,000,000+ relationship rows under InnoDB.
View Full Performance Report
ACF Migration (Escape Meta Technical Debt)
If you store relationships in Advanced Custom Fields relationship fields or standard Post Meta, you can safely migrate to Native Content Relationships to unlock immediate performance and querying benefits.
A built-in script allows you to selectively migrate ACF related data into the new performant table, allowing you to gradually refactor out technical debt.
Check out the dedicated one-time migration guide here: docs/migration/from-acf.md
Advanced Developer APIs
Built to be a complete content relationship modeling engine:

Relationship Type Registration API: Programmatic type registration for custom relationships, with schema validation and strict directional logic.
Relationship Constraints: Declare relationship constraints like 1:1, 1:N, or M:N and strictly enforce maximum capacities and duplicates.
Advanced Query Parameters: Inject the content_relation argument directly into your WP_Query with parameters specifically designed for advanced use cases: include multiple relationship types, apply exclusionary rules, combine OR/AND relations, or filter by minimum/maximum thresholds.
Bulk Operations API: Optimized batch operations to bulk attach, bulk detach, and WP-CLI data import designed specifically for use cases when scaling up and executing large workloads.
Lightweight Metadata Add context to relationships natively using relationship metadata (allow order rankings, contexts, descriptions, tracking data, etc.) via a dedicated relationship metadata registry and table.
Graph Utility Layer An ultra-minimal set of APIs and WP-CLI commands that generate graph diagnostics—useful for acquiring relationship counts, calculating the most connected posts, isolating orphaned items, and running background integrity checks.

Headless REST Readiness
For decoupled and highly dynamic solutions, Native Content Relationships includes powerful headless optimizations:
Append ?naticore_relations=1 or ?_embed=relations into your standard core endpoint fetches (e.g., wp/v2/posts) to embed related data inside your response arrays instantly, minimizing round trips.
Integrations
• WooCommerce (product relationships)
• WPML / Polylang (relationship mirroring)
• Elementor (dynamic content support)
• Gutenberg (related content block)
• Advanced Custom Fields (one-time migration tool)
Page Builder Integration
Elementor:
* Compatible with: Elementor 2.0+
* Features: Comprehensive Dynamic Tags suite for relationships
* Auto-detected: Yes (no configuration needed)
* Tested up to: Elementor 3.20
Elementor Dynamic Tags:
* Related Posts: Display related posts with customizable output formats
* Related Users: Display users with relationships (favorites, bookmarks, etc.)
* Related Terms: Display taxonomy terms with relationships
* Flexible Output: IDs, titles, links, avatars, count-only options
* Direction Support: Both outgoing and incoming relationships
* Native Controls: Relationship type selector with validation
Gutenberg:
* Compatible with: WordPress 5.0+ (Core)
* Features: “Related Content” block with relationship filtering
* Always available: Yes (core WordPress feature)
* Tested up to: WordPress 6.5
Shortcodes
Use these in posts, pages, or widgets. They use the current post ID when not specified.
Related posts (default: type=related_to, limit=5):
[naticore_related_posts type=”related_to” limit=”5″ order=”date” layout=”list” title=”Related Content” class=”my-class”]
Related users (default: type=authored_by):
[naticore_related_users type=”authored_by” limit=”10″ order=”name” layout=”list” title=”Authors”]
Related terms (default: type=categorized_as):
[naticore_related_terms type=”categorized_as” limit=”5″ order=”name” layout=”grid” title=”Categories”]
Attributes (all shortcodes):
* type – Relationship type slug (e.g. related_to, parent_of, authored_by, categorized_as)
* limit – Number of items (1–50), default 5
* order – Sort: date, title (posts) or name (users/terms)
* post_id – Post ID; omit to use current post
* layout – list or grid
* title – Heading text above the list (optional)
* class – Extra CSS class(es) for the wrapper
* show_thumbnail – 1 to show post thumbnail (posts shortcode only), default 0
* excerpt_length – Number of words for excerpt (0 = hide), default 0
Widget
Related Content (NCR) is available under Appearance → Widgets. Add it to any sidebar or widget area.

Title – Optional widget title (leave blank to use the shortcode’s default “Related Content” heading)
Relationship type – e.g. Related To, Parent Of, Depends On
Number of items – 1–50
Order by – Date or Title
Post ID (optional) – Leave 0 to use the current post; set a post ID to show relations for a specific post

Output matches the shortcode (same markup and styles when the shortcode CSS is enqueued).
Developer Guide (Advanced)
This section is intended for developers who want programmatic control.
Core API
Add a relationship:
wp_add_relation( $from_id, $to_id, $type );
Get related items:
wp_get_related( $id, $type );
Check relationship:
wp_is_related( $from_id, $to_id, $type );
Remove relationship:
wp_remove_relation( $from_id, $to_id, $type );
WP_Query Integration
new WP_Query( array(
‘post_type’ => ‘post’,
‘content_relation’ => array(
‘post_id’ => 123,
‘type’ => ‘related_to’,
),
) );
REST API
Endpoints available under:
/wp-json/naticore/v1/
• Create relationships
• Fetch related content
• Delete relationships
Embed relations in core REST responses (headless):
Add ?naticore_relations=1 to any core resource request to include a naticore_relations array in the response. Works with:
• GET /wp-json/wp/v2/posts/?naticore_relations=1
• GET /wp-json/wp/v2/users/?naticore_relations=1
• GET /wp-json/wp/v2/categories/?naticore_relations=1 (and other taxonomies)
Each relation item includes to_id, to_type, type, and optional title/display_name/name. Opt-in only so default requests stay fast.
Hooks & Filters
Actions:
• naticore_relation_added
• naticore_relation_removed
• naticore_after_duplicate_post – fired after copying relations from one post to another (args: from_post_id, to_post_id, result array)
Filters:
• naticore_relation_is_allowed
• naticore_get_related_args
Duplicate post: Use helper naticore_copy_relations( $from_post_id, $to_post_id, $relation_types = null ) to copy relationships when duplicating a post. Returns array with keys copied, skipped, errors. Out-of-the-box integration: Yoast Duplicate Post, Post Duplicator (metaphorcreations), Copy & Delete Posts (Inisev).
Elementor Integration
This plugin provides comprehensive Elementor Dynamic Tags for displaying relationships in Elementor-powered designs.
Available Dynamic Tags:

Related Posts (ncr-related-posts)

Display posts related to the current post
Supports all post-to-post relationship types
Output formats: IDs, titles, links, count
Direction control: outgoing/incoming

Related Users (ncr-related-users)

Display users with relationships to posts
Supports user relationship types (favorites, bookmarks, etc.)
Output formats: IDs, names, emails, avatars, profile links
Direction control: posts-to-users/users-to-posts

Related Terms (ncr-related-terms)

Display taxonomy terms with relationships
Supports term relationship types (categories, tags, etc.)
Output formats: IDs, names, slugs, archive links
Direction control: posts-to-terms/terms-to-posts

Usage Examples:
Display related post IDs:
[ncr-related-posts relationship_type="related_to" output_format="ids" limit="5"]
Display user avatars:
[ncr-related-users relationship_type="favorite_posts" output_format="avatar_images" avatar_size="48"]
Display term links:
[ncr-related-terms relationship_type="categorized_as" output_format="term_links" limit="10"]
Get count of related items:
[ncr-related-posts relationship_type="related_to" output_format="count"]
Advanced Features:
– Context-aware: Automatically detects current post, user, or term context
– Fallback content: Display custom text when no relationships found
– Pagination support: Limit results for performance
– Ordering options: Sort by date, title, or random
– Multi-language: Works with WPML/Polylang translations
Integration Benefits:
– Native Elementor experience: Tags appear in Elementor’s Dynamic Tags panel
– No templates forced: Users control output format and styling
– Performance optimized: Uses cached relationship data
– Optional dependency: Only loads when Elementor is active
WP-CLI
• List relationships
• Add / remove relationships
• Integrity checks
Contributing
Contributions are welcome.
GitHub: https://github.com/chetanupare/WP-Native-Content-Relationships
License
GPLv2 or later

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Native Content Relationships」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0.5 | 1.0.6 | 1.0.7 | 1.0.8 | 1.0.9 | trunk | 1.0.10 | 1.0.12 | 1.0.13 | 1.0.14 | 1.0.15 | 1.0.16 | 1.0.17 | 1.0.18 | 1.0.19 | 1.0.20 | 1.0.23 | 1.0.24 | 1.0.25 | 1.0.26 | 1.0.27 | 1.0.28 | 1.0.29 |

延伸相關外掛(你可能也想知道)

  • Posts 2 Posts 》此外掛允許您在任何類型的文章、頁面或自訂文章之間建立多對多的關係。以下是一些使用範例:, , 手動編輯有關聯的文章清單, 文章系列, 產品與零售商之間的關...。
  • MB Relationships 》MB Relationships 可協助您在文章、頁面或任何自訂文章類型之間建立多對多的關聯。插件輕量且優化了數據庫和查詢性能。, , 插件允許您從文章到文章、文章到頁...。
  • Select 2 Post Selector 》本外掛提供一個程式庫,供開發者使用以建立 AJAX 引擎的下拉式文章選擇框。例如,假如您有一個外掛或主題,建立了一個自訂文章型別稱為「資源」,您希望使用...。
  • UM Relational Fields 》Ultimate Member 可以協助您建立社群。社群在於建立連結。此外掛可以將使用者、文章類型和分類法連結在一起。現在您可以建立真正的連結社群了!, 觀看此 影片...。
  • Link Extension for XFN 》總結:此 XFN 關係鏈接擴展外掛將 XFN(XHTML 朋友網絡)關係選項無縫集成到 WordPress 原生的鏈接介面中。該外掛通過直觀的可折疊接口,增強了每個支持鏈接...。
  • Post Relation Widget 》使用這個小工具可以輕鬆地建立不同類別文章之間的關連。, 您可以在後台建立不同類別文章之間的關連,並且在前台使用簡單的小工具。您可以檢視或刪除現有文章...。

文章
Filter
Apply Filters
Mastodon