Skip to main content
seofields
docs

ImageObject Schema

Add ImageObject structured data to your Sanity documents to provide image metadata and improve Google Images indexing.

About ImageObject Schema

ImageObject schema provides metadata about images, improving Google Images indexing. By adding ImageObject markup, you give search engines explicit information about image dimensions, captions, and licensing, helping your images appear more prominently in image search results and knowledge panels.

Fields

FieldTypeRequiredDescription
urlstringThe URL of the image file.
widthnumberThe width of the image in pixels.
heightnumberThe height of the image in pixels.
captionstringA text caption describing the image content.
namestringA name or title for the image.
descriptionstringA description of the image content.

Plugin Registration

sanity.config.ts
import { defineConfig } from "sanity";
import { seoFields } from "sanity-plugin-seofields";
import { schemaOrgImageObjectPlugin } from "sanity-plugin-seofields/schema";

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

Schema Usage

Add the schemaOrgImageObject 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: 'schemaOrgImageObject',
      title: 'Image Object',
      type: 'schemaOrgImageObject',
    }),
  ],
})

GROQ Query

GROQ query
*[_type == "yourDocumentType"][0]{
  schemaOrgImageObject {
    url,
    width,
    height,
    caption,
    name,
    description
  }
}

Next.js Component

app/page.tsx
import { ImageObjectSchema } from "sanity-plugin-seofields/schema/next";

export default function Page({ data }) {
  return (
    <>
      <ImageObjectSchema data={data.schemaOrgImageObject} />
      {/* Your page content */}
    </>
  );
}

JSON-LD Output

Generated JSON-LD
{
  "@context": "https://schema.org",
  "@type": "ImageObject",
  "url": "https://example.com/photo.jpg",
  "width": 1200,
  "height": 630,
  "caption": "Product hero image",
  "name": "Product hero image",
  "description": "High-resolution hero image for the product landing page."
}

Last updated: May 27, 2026. Tested with: Sanity Studio v3, v4, and v5.

Was this page helpful?