Guide
PostalAddress Schema.org in Sanity
Schema.org PostalAddress describes a physical address with fields such as addressLocality, postalCode, and addressCountry. In Sanity, model it as a reusable structured-data field and nest it inside Organization, LocalBusiness, Restaurant, Person, or Place schema when the page represents a real location.
PostalAddress field map
| Field | Type | Use |
|---|---|---|
streetAddress | string | Street number, street name, unit, or suite. |
addressLocality | string | City, town, or locality. This is the city-level field. |
addressRegion | string | State, province, region, or administrative area when relevant. |
postalCode | string | ZIP code or postal code. Keep it as a string so leading zeroes remain intact. |
addressCountry | string | Country name or ISO 3166-1 alpha-2 country code such as US, GB, IN, or DE. |
JSON-LD example
{
"@context": "https://schema.org",
"@type": "PostalAddress",
"streetAddress": "123 Main St",
"addressLocality": "Springfield",
"addressRegion": "IL",
"postalCode": "62701",
"addressCountry": "US"
}Use it in Sanity
Register the individual PostalAddress plugin when you only need this type, or use the combined schemaOrg() plugin when your project needs multiple structured-data types.
import { defineConfig } from 'sanity'
import { schemaOrgPostalAddressPlugin } from 'sanity-plugin-seofields/schema'
export default defineConfig({
plugins: [
schemaOrgPostalAddressPlugin(),
],
})import { defineField, defineType } from 'sanity'
export default defineType({
name: 'locationPage',
title: 'Location Page',
type: 'document',
fields: [
defineField({
name: 'schemaOrgPostalAddress',
title: 'Postal Address',
type: 'schemaOrgPostalAddress',
}),
],
})Nest inside Organization or LocalBusiness
PostalAddress is often most useful when nested under an entity that owns or operates from the address.
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Acme Studio",
"url": "https://example.com",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main St",
"addressLocality": "Springfield",
"addressRegion": "IL",
"postalCode": "62701",
"addressCountry": "US"
}
}{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "Acme Repair",
"telephone": "+1-555-0100",
"address": {
"@type": "PostalAddress",
"streetAddress": "45 Market Street",
"addressLocality": "Austin",
"addressRegion": "TX",
"postalCode": "78701",
"addressCountry": "US"
}
}Render in Next.js
import { PostalAddressSchema } from 'sanity-plugin-seofields/schema/next'
export default function LocationPage({ data }) {
return (
<>
<PostalAddressSchema data={data.schemaOrgPostalAddress} />
<main>{/* visible page content */}</main>
</>
)
}FAQ
Is postalCode a number or string?
Use a string. Many postal codes contain leading zeroes, letters, spaces, or regional formatting.
Should addressCountry be US or United States?
Both can be understood, but ISO 3166-1 alpha-2 codes such as US, GB, IN, and DE keep data compact and consistent.
Can PostalAddress appear by itself?
It can, but for SEO it is usually stronger when nested inside an Organization, LocalBusiness, Place, Restaurant, or Person that is also represented in visible page content.