Skip to content

Legacy ACF cleanup & CPT unification

Last updated on June 6, 2026

This week focused on finally removing the last of the legacy ACF fields from the Chapter CPTs, along with several structural improvements to artist/song relationships, content capture strategy, CPT unification, and footnotes modularization.

Legacy ACF cleanup & safety scripts

Earlier deletion attempts were too aggressive and risked wiping unrelated data, so the process was reworked into a controlled, multi‑step workflow:

  • Built a dry‑run checker to identify which chapters still hold old field data.
  • Created an interactive per‑chapter deletion script with manual confirmation for extra safety.
  • Added a per‑field bulk cleanup script to clear one field type across all chapters without collateral damage.

This layered approach provides confidence to phase out old fields cleanly without risking Yoast data, featured images, or new CPT fields.

Primary artist & song relationship overhaul

With the legacy primary_artist and primary_song fields now gone, the song‑chapter connection was restructured:

  • Updated Relevanssi indexing so it now pulls artists directly from each Song CPT’s song_artist field.
  • Rebuilt the Music Video block so it looks to the chapter_songs repeater instead of the deleted fields.
  • Audited content-chapter.php and confirmed it already correctly displays artist + song data from the repeater.
  • Reviewed content-song.php and decided to defer taxonomy migration until all songs have feature‑level terms set.
  • Clarified the plan: narrative threads will remain repeater‑driven, while non‑narrative featured songs will eventually be handled via taxonomy.

Incoming CPT & content capture strategy

Relying on bookmarks and external notes was slowing down content organization. Instead, an Incoming CPT is being considered as a messy but public capture pool, allowing new finds to be thrown into the archive immediately without prematurely forcing them into structured CPTs.

  • Decided dangling content is a feature, not a bug — it allows for later enrichment without blocking capture.
  • Clarified the works vs. excerpts vs. quotes distinction (books → excerpts/lyrics → quotes).
  • Introduced a Song Preference taxonomy (“Liked”) to highlight personally enjoyed songs, avoiding unreliable ACF flags.

CPT & taxonomy unification

All CPT registrations were consolidated into a single loader plugin with one file per CPT plus a shared taxonomies.php. Along the way:

  • Fixed inconsistencies (e.g., singular vs. plural CPT slugs — profile vs. profiles) that were breaking permalinks.
  • Ensured every CPT has archives enabled, since redirects depend on them.
  • Restored custom admin labels so CPTs show “Add New Image” or “Add New Quote” instead of the generic “Add New Post.”
  • Centralized archive redirect rules and breadcrumb remaps so all CPTs map cleanly to their dedicated index pages (e.g., /profile//people-referenced/).

Footnotes modularization

The entire footnotes/reference system was moved into /inc/footnotes.php as a standalone module. This keeps the shortcode clean, centralized, and easier to maintain without bloating chapter templates.