docs
LocalBusiness
Add LocalBusiness structured data to your Sanity-powered site. Appear in Google's local pack results and Maps listings with rich business information.
About LocalBusiness
LocalBusiness schema powers Google's local pack results and Maps listings. Structured business data helps your business appear prominently when users search for local services, complete with address, phone number, and business details.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The name of the local business. |
image | string | object | — | Photo of the business — a URL string or a full ImageObject. |
logo | string | object | — | Business logo — a URL string or a full ImageObject. |
telephone | string | — | The phone number of the business. |
address.streetAddress | string | — | The street address of the business. |
address.addressLocality | string | — | The city or locality of the business. |
address.addressCountry | string | — | The country of the business (ISO 3166-1 alpha-2). |
url | string | — | The website URL of the business. |
priceRange | string | — | Price range indicator, e.g. "$", "$$", "$$$". |
geo.latitude | string | — | Latitude coordinate of the business location. |
geo.longitude | string | — | Longitude coordinate of the business location. |
hasMap | string | — | URL to a map showing the location of the business. |
openingHoursSpecification[].dayOfWeek | string | — | Day(s) of the week these hours apply to. |
openingHoursSpecification[].opens | string | — | Opening time in HH:MM format. |
openingHoursSpecification[].closes | string | — | Closing time in HH:MM format. |
sameAs | string | — | URLs of social profiles and other authoritative pages about this business. |
Plugin Registration
sanity.config.ts
import { defineConfig } from "sanity";
import { schemaOrgLocalBusinessPlugin } from "sanity-plugin-seofields/schema";
export default defineConfig({
// ... your project config
plugins: [
schemaOrgLocalBusinessPlugin(),
],
});Schema Usage
Add the schemaOrgLocalBusiness 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: 'schemaOrgLocalBusiness',
title: 'Local Business Schema',
type: 'schemaOrgLocalBusiness',
}),
],
})GROQ Query
GROQ query
*[_type == "yourDocument"][0]{
schemaOrgLocalBusiness {
name,
image,
logo,
telephone,
address {
streetAddress,
addressLocality,
addressCountry
},
url,
priceRange,
geo {
latitude,
longitude
},
hasMap,
openingHoursSpecification[] {
dayOfWeek,
opens,
closes
},
sameAs
}
}Next.js Component
app/layout.tsx
import { LocalBusinessSchema } from "sanity-plugin-seofields/schema/next";
export default function Layout({ children }: { children: React.ReactNode }) {
// Fetch your local business data from Sanity
const localBusiness = await sanityClient.fetch(query);
return (
<html lang="en">
<body>
<LocalBusinessSchema data={localBusiness.schemaOrgLocalBusiness} />
{children}
</body>
</html>
);
}JSON-LD Output
Generated JSON-LD
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "Springfield Coffee House",
"image": "https://example.com/coffee-house.jpg",
"logo": "https://example.com/coffee-house-logo.png",
"telephone": "+1-555-0100",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main St",
"addressLocality": "Springfield",
"addressCountry": "US"
},
"url": "https://springfieldcoffeehouse.example.com",
"priceRange": "$$",
"geo": {
"@type": "GeoCoordinates",
"latitude": "39.7817",
"longitude": "-89.6501"
},
"hasMap": "https://maps.google.com/?q=Springfield+Coffee+House",
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"opens": "07:00",
"closes": "18:00"
}
],
"sameAs": "https://www.facebook.com/springfieldcoffeehouse"
}Last updated: May 27, 2026. Tested with: Sanity Studio v3, v4, and v5.
Was this page helpful?