---
title: "PostalAddress Schema"
description: "Add PostalAddress structured data to Sanity documents — define street, city, country, and postal code for LocalBusiness and Organization schema types."
canonical: https://sanity-plugin-seofields.thehardik.in/docs/schema-org/postal-address
---

# PostalAddress

Add PostalAddress structured data to your Sanity-powered site. Provide structured location data for organizations and local businesses.

## About PostalAddress

PostalAddress provides structured location data, typically nested inside Organization or LocalBusiness. Using structured address data helps search engines accurately understand and display your physical location in search results, maps, and knowledge panels.

## Fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `streetAddress` | string | No | The street address (e.g. 123 Main St). |
| `addressLocality` | string | No | The city or locality. |
| `postalCode` | string | No | The postal or ZIP code. |
| `addressCountry` | string | No | The country (ISO 3166-1 alpha-2 code). |

## Plugin Registration

```typescript
import { defineConfig } from "sanity";
import { schemaOrgPostalAddressPlugin } from "sanity-plugin-seofields/schema";

export default defineConfig({
  // ... your project config
  plugins: [
    schemaOrgPostalAddressPlugin(),
  ],
});
```

## Schema Usage

Add the `schemaOrgPostalAddress` 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: 'schemaOrgPostalAddress',
      title: 'Postal Address',
      type: 'schemaOrgPostalAddress',
    }),
  ],
})
```

## GROQ Query

```javascript
const query = groq`*[_type == "postalAddress"][0]{
  "postalAddress": schemaOrgPostalAddress {
    streetAddress,
    addressLocality,
    postalCode,
    addressCountry
  }
}`;
```

## Next.js Component

```tsx
import { PostalAddressSchema } from "sanity-plugin-seofields/schema/next";

export default function Layout({ children }: { children: React.ReactNode }) {
  // Fetch your postal address data from Sanity
  const postalAddress = await sanityClient.fetch(query);

  return (
    <html lang="en">
      <body>
        <PostalAddressSchema data={postalAddress.postalAddress} />
        {children}
      </body>
    </html>
  );
}
```

## JSON-LD Output

```json
{
  "@context": "https://schema.org",
  "@type": "PostalAddress",
  "streetAddress": "123 Main St",
  "addressLocality": "Springfield",
  "postalCode": "62701",
  "addressCountry": "US"
}
```
