Skip to content

Tag audit refactor for portal pruning

Last updated on June 8, 2026

The original Tag Audit tool was built to identify content lacking Topic and Theme assignments. It queried all supported content types and highlighted entries that were missing one or both taxonomies. This was useful during the early stages of taxonomy adoption when coverage gaps were common.

As AI‑assisted tagging expanded across the site, the maintenance problem changed. Missing tags became increasingly rare, while inaccurate or overly broad Topic and Theme assignments became more common. The goal of the tool shifted from finding omissions to reviewing and pruning taxonomy relationships.

Original audit workflow

The original implementation worked by querying all supported content types and evaluating whether each entry had Theme and Topic assignments.

Example logic:

$themes = get_the_terms($id, 'theme');
$topics = get_the_terms($id, 'topic');

$has_theme = !empty($themes);
$has_topic = !empty($topics);

The tool then exposed several review modes:

  • Missing Both
  • Missing Theme
  • Missing Topic
  • Show All

This approach was effective when taxonomy coverage was incomplete, but it provided little assistance when reviewing whether an assigned taxonomy was actually appropriate.

New review philosophy

The refactor introduces a different workflow. Instead of asking:

“Which entries are missing tags?”

The tool asks:

“Which entries no longer belong under this Topic or Theme?”

This is especially important because portal pages aggregate content automatically based on shared taxonomy relationships. Incorrect Topic or Theme assignments directly impact portal quality, making taxonomy pruning an increasingly important maintenance task.

Taxonomy review interface

The revised tool focuses on high‑value Topics and Themes rather than missing assignments.

The proposed interface presents:

  • Top Themes by usage count
  • Top Topics by usage count
  • Expandable review sections
  • Checkbox‑based selection of questionable entries

Example:

▼ Knowledge Systems (143)

☐ Book A
☐ Quote B
☐ Lyric C
☐ Image D

Each entry remains linked to its source content, allowing rapid verification while reviewing taxonomy relationships.

ID export workflow

Instead of immediately modifying taxonomy assignments, the tool generates exportable ID lists.

Selected entries are grouped by content type and exported in a structured format:

theme|Knowledge Systems

book:123,456
quote:789
lyric:321

This output can be passed into dedicated maintenance scripts that perform the actual taxonomy removal process.

Separating review from execution provides several benefits:

  • Human verification remains part of the workflow.
  • Bulk changes can be staged and reviewed.
  • Removal scripts remain reusable and independent of the review interface.

JavaScript export function

The export process relies on a lightweight JavaScript helper that gathers checked entries and groups them by content type.

Conceptually:

const grouped = {};

checked.forEach(item => {
    const type = item.dataset.type;
    const id   = item.dataset.id;

    if (!grouped[type]) {
        grouped[type] = [];
    }

    grouped[type].push(id);
});

The resulting grouped output is then written to a textarea for copying into taxonomy maintenance scripts.

Future direction

During planning, a second‑generation approach emerged that would use Portal CPTs as the primary review object rather than browsing Topics and Themes directly.

The rationale is that portals represent the curated subset of Topics and Themes that are important enough to receive ongoing maintenance. Rather than reviewing all taxonomy terms, future versions may:

  • Query Portal CPTs.
  • Determine attached Topic and Theme terms.
  • Load related content.
  • Review portal membership directly.
  • Generate taxonomy‑removal exports.

This would align the review workflow with the site’s actual curation model and reduce unnecessary taxonomy review.

Outcome

The Tag Audit tool is evolving from a completeness checker into a portal‑support maintenance utility. As AI‑assisted tagging continues to improve coverage, the primary challenge becomes maintaining taxonomy accuracy. This refactor establishes the foundation for a scalable review process focused on pruning incorrect relationships and improving the quality of portal‑driven content aggregation.