Bringing Missing Metadata to FLAC and OGG Audio Files (Trac #66417)

Introduction
Audio creators and podcasters often rely on high-fidelity formats like FLAC and OGG Vorbis. However, when uploading these files to WordPress, essential information like Title, Artist, and Album would mysteriously disappear in the Media Library. I contributed to Trac Ticket #66417 to verify a patch that fixes this limitation.

Why Were Tags Disappearing?
Under the hood, WordPress’s wp_read_audio_metadata() helper relied primarily on wp_add_id3_tag_data(). While MP3 files store metadata in ID3 tags, FLAC and OGG files store metadata as Vorbis comments, and M4A files use QuickTime atoms. Because Core didn’t map these alternative structures into its standard metadata keys, all audio tags were dropped upon upload.

Testing the Patch (PR #15185)

  1. I tested the implementation against trunk using real audio files formatted in FLAC, MP3, and OGG.
  2. With the patch active, WordPress now checks for Vorbis comments and QuickTime atoms whenever ID3 tags are absent, seamlessly mapping fields like albumartist to band and date to year.
  3. After uploading the test tracks, I verified that Title, Artist, and Album metadata were instantly populated in the Media Library attachment details.

Leave a Reply