docs
Event Schema
Add Event structured data to your Sanity documents to power rich results for conferences, meetups, concerts, and workshops.
About Event Schema
Event schema powers rich results for conferences, meetups, concerts, and workshops. When properly implemented, Google can display event details directly in search results, including dates, locations, and ticket information, driving more qualified traffic to your event pages.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Required | The name of the event. |
| startDate | datetime | Optional | The start date and time of the event in ISO 8601 format. |
| location.name | string | Optional | The name of the venue or location where the event takes place. |
| location.address | string | Optional | The street address of the event location. |
Plugin Registration
sanity.config.ts
import { defineConfig } from "sanity";
import { seoFields } from "sanity-plugin-seofields";
import { schemaOrgEventPlugin } from "sanity-plugin-seofields/schema";
export default defineConfig({
// ...your sanity config
plugins: [
seoFields(),
schemaOrgEventPlugin(),
],
});Schema Usage
Add theschemaOrgEvent field to any document schema:
schemas/page.ts
import { defineField, defineType } from 'sanity'
export default defineType({
name: 'page',
title: 'Page',
type: 'document',
fields: [
// ... your other fields
defineField({
name: 'schemaOrgEvent',
title: 'Event Schema',
type: 'schemaOrgEvent',
}),
],
})GROQ Query
GROQ
*[_type == "yourDocumentType"][0]{
...,
schemaOrgEvent
}Next.js Component
app/page.tsx
import { EventSchema } from "sanity-plugin-seofields/schema-org/next";
export default function Page({ data }) {
return (
<>
<EventSchema data={data.schemaOrgEvent} />
{/* Your page content */}
</>
);
}JSON-LD Output
JSON-LD
{
"@context": "https://schema.org",
"@type": "Event",
"name": "Tech Conference 2025",
"startDate": "2025-06-15T09:00:00",
"location": {
"@type": "Place",
"name": "Convention Center",
"address": "123 Main St"
}
}Was this page helpful?