---
title: "MusicAlbum Schema"
description: "Add Schema.org MusicAlbum structured data to your Sanity-powered site with sanity-plugin-seofields. Mark up albums with artist, track count, production type, and release date."
canonical: https://sanity-plugin-seofields.thehardik.in/docs/schema-org/music-album
---

# 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&apos;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 | Yes | The name of the album. |
| `description` | text | No | A description of the album. |
| `image` | url \| ImageObject | No | Album cover art. |
| `byArtist` | url \| Person | No | The artist who created this album. |
| `numTracks` | number | No | Total number of tracks on the album. |
| `albumProductionType` | string | No | How the album was produced — StudioAlbum, LiveAlbum, CompilationAlbum, etc. |
| `datePublished` | date | No | Release date of the album. |

## Plugin Registration

```typescript
import { defineConfig } from 'sanity'
import { schemaOrgMusicAlbumPlugin } from 'sanity-plugin-seofields/schema'

export default defineConfig({
  plugins: [
    schemaOrgMusicAlbumPlugin(),
  ],
})
```

## Schema Usage

Add the `schemaOrgMusicAlbum` field to any document schema:

```typescript
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

```javascript
*[_type == "album"][0]{
  schemaOrgMusicAlbum {
    name,
    description,
    image,
    byArtist,
    numTracks,
    albumProductionType,
    datePublished
  }
}
```

## Next.js Component

```tsx
import { MusicAlbumSchema } from 'sanity-plugin-seofields/schema/next'

export default function Page({ data }) {
  return <MusicAlbumSchema data={data.schemaOrgMusicAlbum} />
}
```

## JSON-LD Output

```json
{
  "@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"
}
```
