---
title: "ImageObject Schema"
description: "Add ImageObject structured data to your Sanity documents. Provide image metadata to improve Google Images indexing with schema.org markup."
canonical: https://sanity-plugin-seofields.thehardik.in/docs/schema-org/image-object
---

# 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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | Yes | The URL of the image file. |
| `width` | number | No | The width of the image in pixels. |
| `height` | number | No | The height of the image in pixels. |
| `caption` | string | No | A text caption describing the image content. |
| `name` | string | No | A name or title for the image. |
| `description` | string | No | A description of the image content. |

## Plugin Registration

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

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

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

## Next.js Component

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

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