docs
LegalService
The LegalService schema type identifies a legal professional or firm — solicitors, attorneys, notaries, and specialised legal practices. It feeds Google's local pack, knowledge panel, and AI overviews when potential clients search for representation.
About LegalService
LegalService is a specialised LocalBusiness subtype tailored to law firms. The knowsAbout array is critical — it tells search engines which practice areas you cover so you appear for queries like "immigration lawyer in Boston". Always include accurate address and openingHoursSpecification data; these are the signals Google uses to rank legal firms in the local pack.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The official firm name. |
description | string | — | A brief description of the legal service or firm. |
image | string | object | — | Logo or office photo representing the firm. |
telephone | string | — | Primary contact telephone. |
url | string | — | Firm website URL. |
priceRange | string | — | Price indicator, e.g. "$$" or "$100–$500". |
address.streetAddress | string | — | Street address of the firm's office. |
address.addressLocality | string | — | City of the firm's office. |
address.addressRegion | string | — | State or region of the firm's office. |
address.postalCode | string | — | Postal code of the firm's office. |
address.addressCountry | string | — | Country of the firm's office. |
geo.latitude | string | — | Latitude coordinate of the office location. |
geo.longitude | string | — | Longitude coordinate of the office location. |
hasMap | string | — | URL to a map showing the location of the office. |
knowsAbout | array of strings | — | Practice areas — Family Law, IP Litigation, etc. |
knowsLanguage | array of strings | — | Languages the firm operates in. |
areaServed | array of strings | — | Geographic areas served. |
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 firm. |
Plugin Registration
sanity.config.ts
import { defineConfig } from 'sanity'
import { schemaOrgLegalServicePlugin } from 'sanity-plugin-seofields/schema'
export default defineConfig({
plugins: [
schemaOrgLegalServicePlugin(),
],
})Schema Usage
Add theschemaOrgLegalService field to any document schema:
schemas/firm.ts
import { defineField, defineType } from 'sanity'
export default defineType({
name: 'firm',
title: 'Firm',
type: 'document',
fields: [
defineField({
name: 'schemaOrgLegalService',
title: 'LegalService Schema',
type: 'schemaOrgLegalService',
}),
],
})GROQ Query
GROQ query
*[_type == "firm"][0]{
schemaOrgLegalService {
name,
description,
image,
telephone,
url,
priceRange,
address {
streetAddress,
addressLocality,
addressRegion,
postalCode,
addressCountry
},
geo {
latitude,
longitude
},
hasMap,
knowsAbout,
knowsLanguage,
areaServed,
openingHoursSpecification[] {
dayOfWeek,
opens,
closes
},
sameAs
}
}Next.js Component
app/firm/page.tsx
import { LegalServiceSchema } from 'sanity-plugin-seofields/schema/next'
export default function Page({ data }) {
return <LegalServiceSchema data={data.schemaOrgLegalService} />
}JSON-LD Output
Generated JSON-LD
{
"@context": "https://schema.org",
"@type": "LegalService",
"name": "Hartwell & Mendez Attorneys",
"description": "Boutique immigration and family law firm serving the Boston metro area.",
"image": "https://example.com/firm/logo.png",
"telephone": "+1-617-555-0142",
"url": "https://hartwell-mendez.example.com",
"priceRange": "$$",
"address": {
"@type": "PostalAddress",
"streetAddress": "120 Tremont St, Suite 400",
"addressLocality": "Boston",
"addressRegion": "MA",
"postalCode": "02108",
"addressCountry": "US"
},
"geo": {
"@type": "GeoCoordinates",
"latitude": "42.3554",
"longitude": "-71.0640"
},
"hasMap": "https://maps.google.com/?q=Hartwell+Mendez+Attorneys+Boston",
"knowsAbout": ["Immigration Law", "Family Law", "Asylum"],
"knowsLanguage": ["English", "Spanish", "Portuguese"],
"areaServed": ["Boston", "Cambridge", "Massachusetts"],
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": "Monday",
"opens": "09:00",
"closes": "18:00"
}
],
"sameAs": "https://www.linkedin.com/company/hartwell-mendez"
}Was this page helpful?