Skip to main content
seofields
docs
.md

Book

The Book schema type describes a published book — whether print, ebook, or audiobook. It powers Google's book knowledge panel, links readers to retailers, and helps libraries and search assistants disambiguate titles by ISBN and format.

About Book

Use Book markup on dedicated title pages on a publisher, author, or review site. The isbn field is the canonical identifier search engines and AI assistants use to merge data from multiple sources, so always include it when known. Pair Book with an AggregateRating block on review pages, and link the author via the Person type so your knowledge graph stays connected.

Fields

FieldTypeRequiredDescription
namestring✓The title of the book.
descriptiontext—A description or summary of the book.
imageurl | ImageObject—Cover image of the book — choose a URL or full ImageObject.
authorurl | Person—The author of the book — either a URL reference or a full Person object.
publisherurl | Organization—The publisher — either a URL reference or a full Organization object.
isbnstring—International Standard Book Number (ISBN-10 or ISBN-13).
bookFormatstring—Format URL: Hardcover, Paperback, EBook, AudiobookFormat, or GraphicNovel.

Plugin Registration

sanity.config.ts
import { defineConfig } from 'sanity'
import { schemaOrgBookPlugin } from 'sanity-plugin-seofields/schema'

export default defineConfig({
  // ... your sanity config
  plugins: [
    schemaOrgBookPlugin(),
  ],
})

Schema Usage

Add the schemaOrgBook field to any document schema:

schemas/book.ts
import { defineField, defineType } from 'sanity'

export default defineType({
  name: 'book',
  title: 'Book',
  type: 'document',
  fields: [
    // ... your other fields
    defineField({
      name: 'schemaOrgBook',
      title: 'Book Schema',
      type: 'schemaOrgBook',
    }),
  ],
})

GROQ Query

GROQ query
*[_type == "book"][0]{
  schemaOrgBook {
    name,
    description,
    image,
    author,
    publisher,
    isbn,
    bookFormat
  }
}

Next.js Component

app/layout.tsx
import { BookSchema } from 'sanity-plugin-seofields/schema/next'

export default function Layout({ data }) {
  return <BookSchema data={data.schemaOrgBook} />
}

JSON-LD Output

Generated JSON-LD
{
  "@context": "https://schema.org",
  "@type": "Book",
  "name": "The Pragmatic Programmer",
  "description": "Classic guide to mastering the craft of software development.",
  "image": "https://example.com/books/pragmatic-programmer.jpg",
  "author": {
    "@type": "Person",
    "name": "David Thomas"
  },
  "publisher": {
    "@type": "Organization",
    "name": "Addison-Wesley Professional"
  },
  "isbn": "978-0135957059",
  "bookFormat": "https://schema.org/Paperback"
}

Was this page helpful?