---
title: "MusicRecording Schema"
description: "Add Schema.org MusicRecording structured data to your Sanity-powered site with sanity-plugin-seofields. Mark up tracks with artist, duration, album, and release date."
canonical: https://sanity-plugin-seofields.thehardik.in/docs/schema-org/music-recording
---

# MusicRecording

The MusicRecording schema type describes a single music track or sound recording. It is the building block of music metadata — used by streaming services, lyric sites, and label catalogues to surface tracks in Google&apos;s music carousel.

## About MusicRecording

Always express duration in ISO 8601 (e.g. PT3M45S) — Google rejects free-form durations like &quot;3:45&quot;. For full discography pages, group recordings under their parent  MusicAlbum  so search engines can model the relationship between an album and its tracks.

## Fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | Yes | The name of the music recording (track title). |
| `description` | text | No | A description of the music recording. |
| `image` | url \| ImageObject | No | Cover art or image for the recording. |
| `byArtist` | url \| Person | No | The artist who performed this track. |
| `duration` | string | No | ISO 8601 duration, e.g. "PT3M45S" for 3m 45s. |
| `inAlbum` | string | No | The name of the album this recording appears in. |
| `datePublished` | date | No | Release date of this recording. |

## Plugin Registration

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

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

## Schema Usage

Add the `schemaOrgMusicRecording` field to any document schema:

```typescript
import { defineField, defineType } from 'sanity'

export default defineType({
  name: 'track',
  title: 'Track',
  type: 'document',
  fields: [
    defineField({
      name: 'schemaOrgMusicRecording',
      title: 'MusicRecording Schema',
      type: 'schemaOrgMusicRecording',
    }),
  ],
})
```

## GROQ Query

```javascript
*[_type == "track"][0]{
  schemaOrgMusicRecording {
    name,
    description,
    image,
    byArtist,
    duration,
    inAlbum,
    datePublished
  }
}
```

## Next.js Component

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

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

## JSON-LD Output

```json
{
  "@context": "https://schema.org",
  "@type": "MusicRecording",
  "name": "Get Lucky",
  "description": "Lead single from Random Access Memories featuring Pharrell Williams and Nile Rodgers.",
  "image": "https://example.com/covers/get-lucky.jpg",
  "byArtist": {
    "@type": "MusicGroup",
    "name": "Daft Punk"
  },
  "duration": "PT6M07S",
  "inAlbum": "Random Access Memories",
  "datePublished": "2013-04-19"
}
```
