Skip to main content
seofields
docs
.md

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

FieldTypeRequiredDescription
namestring✓The official firm name.
descriptionstring—A brief description of the legal service or firm.
imagestring | object—Office photo or another representative image for the firm.
logostring | object—Firm logo — a URL string or a full ImageObject.
telephonestring—Primary contact telephone.
urlstring—Firm website URL.
priceRangestring—Price indicator, e.g. "$$" or "$100–$500".
address.streetAddressstring—Street address of the firm's office.
address.addressLocalitystring—City of the firm's office.
address.addressRegionstring—State or region of the firm's office.
address.postalCodestring—Postal code of the firm's office.
address.addressCountrystring—Country of the firm's office.
geo.latitudestring—Latitude coordinate of the office location.
geo.longitudestring—Longitude coordinate of the office location.
hasMapstring—URL to a map showing the location of the office.
knowsAboutarray of strings—Practice areas — Family Law, IP Litigation, etc.
knowsLanguagearray of strings—Languages the firm operates in.
areaServedarray of strings—Geographic areas served.
openingHoursSpecification[].dayOfWeekstring—Day(s) of the week these hours apply to.
openingHoursSpecification[].opensstring—Opening time in HH:MM format.
openingHoursSpecification[].closesstring—Closing time in HH:MM format.
sameAsstring—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 the schemaOrgLegalService 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,
    logo,
    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/office.jpg",
  "logo": "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?