docs
MusicAlbum
The MusicAlbum schema type describes a collection of music tracks released as a single body of work. Use it on artist discographies, label catalogues, and review sites to feed Google's music carousel and knowledge panels.
About MusicAlbum
Setting albumProductionType helps search engines distinguish a studio LP from a live recording, mixtape, or compilation — useful disambiguation when an artist has many releases sharing similar names. Pair the album with its individual tracks via the MusicRecording type for a complete music graph.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The name of the album. |
description | text | — | A description of the album. |
image | url | ImageObject | — | Album cover art. |
byArtist | url | Person | — | The artist who created this album. |
numTracks | number | — | Total number of tracks on the album. |
albumProductionType | string | — | How the album was produced — StudioAlbum, LiveAlbum, CompilationAlbum, etc. |
datePublished | date | — | Release date of the album. |
Plugin Registration
sanity.config.ts
import { defineConfig } from 'sanity'
import { schemaOrgMusicAlbumPlugin } from 'sanity-plugin-seofields/schema'
export default defineConfig({
plugins: [
schemaOrgMusicAlbumPlugin(),
],
})Schema Usage
Add theschemaOrgMusicAlbum field to any document schema:
schemas/album.ts
import { defineField, defineType } from 'sanity'
export default defineType({
name: 'album',
title: 'Album',
type: 'document',
fields: [
defineField({
name: 'schemaOrgMusicAlbum',
title: 'MusicAlbum Schema',
type: 'schemaOrgMusicAlbum',
}),
],
})GROQ Query
GROQ query
*[_type == "album"][0]{
schemaOrgMusicAlbum {
name,
description,
image,
byArtist,
numTracks,
albumProductionType,
datePublished
}
}Next.js Component
app/album/[slug]/page.tsx
import { MusicAlbumSchema } from 'sanity-plugin-seofields/schema/next'
export default function Page({ data }) {
return <MusicAlbumSchema data={data.schemaOrgMusicAlbum} />
}JSON-LD Output
Generated JSON-LD
{
"@context": "https://schema.org",
"@type": "MusicAlbum",
"name": "Random Access Memories",
"description": "The fourth and final studio album by French electronic music duo Daft Punk.",
"image": "https://example.com/covers/ram.jpg",
"byArtist": {
"@type": "MusicGroup",
"name": "Daft Punk"
},
"numTracks": 13,
"albumProductionType": "https://schema.org/StudioAlbum",
"datePublished": "2013-05-17"
}Was this page helpful?