Skip to main content
seofields
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

FieldTypeRequiredDescription
namestringThe name of the local business.
imagestring | objectPhoto of the business — a URL string or a full ImageObject.
logostring | objectBusiness logo — a URL string or a full ImageObject.
telephonestringThe phone number of the business.
address.streetAddressstringThe street address of the business.
address.addressLocalitystringThe city or locality of the business.
address.addressCountrystringThe country of the business (ISO 3166-1 alpha-2).
urlstringThe website URL of the business.
priceRangestringPrice range indicator, e.g. "$", "$$", "$$$".
geo.latitudestringLatitude coordinate of the business location.
geo.longitudestringLongitude coordinate of the business location.
hasMapstringURL to a map showing the location of the business.
openingHoursSpecification[].dayOfWeekstringDay(s) of the week these hours apply to.
openingHoursSpecification[].opensstringOpening time in HH:MM format.
openingHoursSpecification[].closesstringClosing time in HH:MM format.
sameAsstringURLs 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?