XooCode(){

MusicAlbum

MusicAlbum represents a collection of tracks: a studio album, a soundtrack, an EP, a compilation. Like MusicRecording, it feeds the music knowledge panel and streaming platform metadata rather than earning a standalone Google rich result. The markup helps Google group tracks under an album entity and display album art, track counts, and release dates in the knowledge panel.

The central property is track, which lists the album's tracks as an ItemList of MusicRecording references. Each track can be a full MusicRecording object or an @id reference to a MusicRecording defined elsewhere. The numTracks property gives the total count.

Full example of schema.org/MusicAlbum json-ld markup

The markup is verified as valid with Rich Results Test from Google.

Highlight legend:Required by GoogleRecommendedOptional
schema.org/MusicAlbum
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@id": "https://xoofilms.dk/music/the-childrens-doctor-score#album",
  "@type": "MusicAlbum",
  "name": "The Children's Doctor: Original Score",
  "url": "https://xoofilms.dk/music/the-childrens-doctor-score",
  "byArtist": {
    "@type": "Person",
    "name": "Nora Lindgren",
    "url": "https://noralindgren.dk"
  },
  "image": "https://xoofilms.dk/music/the-childrens-doctor-score/cover.jpg",
  "datePublished": "2024-09-14",
  "numTracks": 12,
  "albumProductionType": "https://schema.org/SoundtrackAlbum",
  "albumReleaseType": "https://schema.org/AlbumRelease",
  "genre": "Film Score",
  "inLanguage": "da",
  "copyrightYear": "2024",
  "copyrightHolder": {
    "@type": "Organization",
    "name": "Xoo Films ApS"
  },
  "track": {
    "@type": "ItemList",
    "numberOfItems": 12,
    "itemListElement": [
      {
        "@type": "ListItem",
        "position": 1,
        "item": {
          "@type": "MusicRecording",
          "name": "The Ward at Dawn",
          "duration": "PT3M12S"
        }
      },
      {
        "@type": "ListItem",
        "position": 2,
        "item": {
          "@type": "MusicRecording",
          "name": "Framework (Main Theme)",
          "duration": "PT5M47S"
        }
      },
      {
        "@type": "ListItem",
        "position": 3,
        "item": {
          "@id": "https://xoofilms.dk/music/lullaby-for-copenhagen#recording"
        }
      },
      {
        "@type": "ListItem",
        "position": 4,
        "item": {
          "@type": "MusicRecording",
          "name": "Rigshospitalet, 1946",
          "duration": "PT6M01S"
        }
      },
      {
        "@type": "ListItem",
        "position": 5,
        "item": {
          "@type": "MusicRecording",
          "name": "Recovery",
          "duration": "PT4M38S"
        }
      }
    ]
  },
  "about": {
    "@id": "https://xoofilms.dk/the-childrens-doctor#movie"
  }
}
</script>

track as ItemList

The track property takes an ItemList with ListItem entries, each wrapping a MusicRecording. The position on each ListItem gives the track number. This is the same pattern as ItemList for carousels, reused for track ordering. You can also pass track as a flat array of MusicRecording objects if you do not need explicit track numbers.

albumProductionType and albumReleaseType

albumProductionType describes how the album was produced: StudioAlbum, LiveAlbum, CompilationAlbum, RemixAlbum, SoundtrackAlbum, etc. albumReleaseType describes the commercial format: AlbumRelease, SingleRelease, EPRelease, BroadcastRelease. Both use schema.org enum values as full URLs. Google reads these to categorize albums in the knowledge panel.

byArtist on albums

The byArtist on a MusicAlbum is the album-level credit. Individual tracks can have their own byArtist for guest features or collaborations. If every track is by the same artist, set byArtist on the album and omit it from individual tracks. If tracks have different artists (like a compilation), set byArtist on each track and optionally use "Various Artists" at the album level.

Minimal valid version

The smallest markup that still produces a valid MusicAlbum entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.

schema.org/MusicAlbum (minimal)
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "MusicAlbum",
  "name": "The Children's Doctor: Original Score",
  "byArtist": {
    "@type": "Person",
    "name": "Nora Lindgren"
  },
  "numTracks": 12
}
</script>

Google rich results this unlocks

Markup matching this example makes your page eligible for the following Google Search rich results. The primary target drives the required / recommended property classification in the advanced code block above.

Common MusicAlbum mistakes

Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.

  1. 01

    albumProductionType as a plain string

    Wrong
    "albumProductionType": "Soundtrack"
    Right
    "albumProductionType": "https://schema.org/SoundtrackAlbum"

    albumProductionType expects a full schema.org URL. Valid values include StudioAlbum, LiveAlbum, CompilationAlbum, SoundtrackAlbum, RemixAlbum, and others. Plain strings are not reliably parsed.

  2. 02

    numTracks that doesn't match the track list

    Wrong
    "numTracks": 12 with only 5 tracks in the track array
    Right
    "numTracks": 12 representing the full album; the track array can be a partial listing

    numTracks is the total number of tracks on the album, not the number of MusicRecording objects in your markup. You can include a subset of tracks in the markup (like the first 5 of 12) while reporting the correct total. But if numTracks is less than the number of tracks in your array, that is a bug.

  3. 03

    Missing byArtist at album level for single-artist albums

    Wrong
    MusicAlbum with byArtist only on individual tracks
    Right
    "byArtist": { "@type": "Person", "name": "Nora Lindgren" } on the MusicAlbum

    Set byArtist on the album when all tracks share the same artist. This gives Google the album-level credit it needs for the knowledge panel. Individual tracks inherit the album artist unless they override it with their own byArtist for guest features.

  4. 04

    Track list without positions

    Wrong
    "track": [{ "@type": "MusicRecording", "name": "..." }, ...]
    Right
    "track": { "@type": "ItemList", "itemListElement": [{ "@type": "ListItem", "position": 1, "item": { "@type": "MusicRecording", "name": "..." } }] }

    A flat array of MusicRecording objects works but loses track ordering information. The ItemList pattern with ListItem positions preserves the intended track order. This matters for albums where track sequence is part of the artistic intent.

About the example data

The album is the original score for The Children's Doctor documentary, composed by Nora Lindgren. Track 3 references the Lullaby for Copenhagen MusicRecording via @id. The publisher is Xoo Films ApS, the same production company from the Movie example.

Comments

Loading comments...

Leave a comment