Skip to content

Converting Song Titles to CPT Links in Narrative Chapters

Last updated on August 18, 2025

I’m in the process of converting all song title fields in my narrative chapter pages into proper Song CPT relationships. Once each song is represented as a CPT, I can update the template code to pull and link the song title automatically beneath the artist link.

The migration itself should be straightforward, but time-consuming. I’ll need to delete the old text-based song fields and replace them with linked CPT fields. Ideally, I can automate this by comparing the original text to existing Song CPT titles, then deleting the matched text and its field afterward.

Once converted, I’ll update the chapter templates to display the song link next to or beneath the artist link. I’ll also need to update the [referenced_works] footnote system to display the song alongside the artist. The tricky part will be supporting multi-song chapters, especially those with multiple featured artists, while maintaining clarity and proper ordering.

Published incompleted