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

FieldTypeRequiredDescription
namestringThe official firm name.
descriptionstringA brief description of the legal service or firm.
imagestring | objectLogo or office photo representing the firm.
telephonestringPrimary contact telephone.
urlstringFirm website URL.
priceRangestringPrice indicator, e.g. "$$" or "$100–$500".
address.streetAddressstringStreet address of the firm's office.
address.addressLocalitystringCity of the firm's office.
address.addressRegionstringState or region of the firm's office.
address.postalCodestringPostal code of the firm's office.
address.addressCountrystringCountry of the firm's office.
geo.latitudestringLatitude coordinate of the office location.
geo.longitudestringLongitude coordinate of the office location.
hasMapstringURL to a map showing the location of the office.
knowsAboutarray of stringsPractice areas — Family Law, IP Litigation, etc.
knowsLanguagearray of stringsLanguages the firm operates in.
areaServedarray of stringsGeographic areas served.
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 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?