Skip to content

Admin & Tools

NCR provides several admin screens and background tools to view, clean, and maintain relationship data. Access most of them under Settings → Content Relationships (tabs or sub-pages depending on version).


Overview table

A read-only list table of all relationships in the database.

  • Columns: From, Type, To, Direction, Date.
  • Sortable: By date, type.
  • Pagination: Configurable per page (e.g. 20 items).
  • Use case: Audit relations, find by type or post.

Location: typically Content Relationships → Overview or similar in the plugin menu.


Integrity check

Finds and optionally removes invalid relationships: rows where the source or target post/user/term no longer exists (e.g. content was deleted).

  • Automatic: Runs once per day in the background (admin init). No UI required.
  • Manual (WP-CLI):
    wp content-relations check — report only
    wp content-relations check --fix — remove invalid rows
    wp content-relations check --fix --verbose — list each cleaned ID
    wp content-relations sync — same as check with optional --fix (alias behavior).
  • Batch size: Use --batch-size=500 for large tables.

See WP-CLI.


Orphaned relationships

Orphaned = relations whose from_id or to_id points to deleted content. The Orphaned tool checks for these (e.g. once per week) and can show an admin notice when the count is greater than zero, with a link to run cleanup (Integrity check) or view the overview.

  • Notice: Dismissible; encourages running an integrity check or visiting the tools page.
  • Cleanup: Use Integrity check with Fix (admin or WP-CLI) to delete orphaned rows.

Import / Export

Export: Download all relationships as a JSON file. Use before migrations or bulk changes.

Import: Upload a previously exported JSON file. Adds relationships; does not delete existing ones. Duplicates (same from_id, to_id, type) are skipped.

  • Location: Settings → Content Relationships → Import/Export (or Tools submenu).
  • Permissions: manage_options (administrator).
  • Use case: Backup, migrate between sites (ensure post/user/term IDs match on destination), or restore after a mistake.

Site Health

NCR adds a Relationship Integrity test under Tools → Site Health.

  • What it does: Runs a quick integrity audit (e.g. dry run, small batch). If invalid relations are found, status is “Recommended” and the description suggests running a manual integrity check.
  • Action link: Points to the Integrity/Tools page so you can run a full check or fix.

Auto-relations (optional)

Automatic relations on publish: When enabled in settings, publishing a post can automatically create a relationship to its parent (e.g. page hierarchy) using the type part_of.

  • Setting: Settings → Content Relationships — enable “Auto relation” and choose post types (e.g. post, page).
  • Behavior: On publish_{post_type}, if the post has a parent, NCR creates a part_of relation from the new post to the parent (if not already related).
  • Use case: Keep “child” content linked to parent pages without manual linking.

Summary

FeatureWherePurpose
Overview tableContent Relationships menuView all relations
Integrity checkBackground + WP-CLI check --fixRemove invalid/orphaned rows
Orphaned noticeAdmin notice (weekly check)Alert when orphans exist
Import/ExportSettings → Content RelationshipsBackup, migrate, restore
Site Health testTools → Site HealthQuick integrity status
Auto-relationsSettings (optional)Auto link to parent on publish

See also

  • WP-CLIlist, add, remove, check, sync, schema
  • Troubleshooting — Duplicate or wrong relations after migration

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