---
title: "LegalService Schema"
description: "Add Schema.org LegalService structured data to your Sanity-powered site with sanity-plugin-seofields. Surface law firms in local search with practice areas, hours, and address."
canonical: https://sanity-plugin-seofields.thehardik.in/docs/schema-org/legal-service
---

# LegalService

The LegalService schema type identifies a legal professional or firm — solicitors, attorneys, notaries, and specialised legal practices. It feeds Google&apos;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 &quot;immigration lawyer in Boston&quot;. 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 | Yes | The official firm name. |
| `description` | string | No | A brief description of the legal service or firm. |
| `image` | string \| object | No | Office photo or another representative image for the firm. |
| `logo` | string \| object | No | Firm logo — a URL string or a full ImageObject. |
| `telephone` | string | No | Primary contact telephone. |
| `url` | string | No | Firm website URL. |
| `priceRange` | string | No | Price indicator, e.g. "$$" or "$100–$500". |
| `address.streetAddress` | string | No | Street address of the firm's office. |
| `address.addressLocality` | string | No | City of the firm's office. |
| `address.addressRegion` | string | No | State or region of the firm's office. |
| `address.postalCode` | string | No | Postal code of the firm's office. |
| `address.addressCountry` | string | No | Country of the firm's office. |
| `geo.latitude` | string | No | Latitude coordinate of the office location. |
| `geo.longitude` | string | No | Longitude coordinate of the office location. |
| `hasMap` | string | No | URL to a map showing the location of the office. |
| `knowsAbout` | array of strings | No | Practice areas — Family Law, IP Litigation, etc. |
| `knowsLanguage` | array of strings | No | Languages the firm operates in. |
| `areaServed` | array of strings | No | Geographic areas served. |
| `openingHoursSpecification[].dayOfWeek` | string | No | Day(s) of the week these hours apply to. |
| `openingHoursSpecification[].opens` | string | No | Opening time in HH:MM format. |
| `openingHoursSpecification[].closes` | string | No | Closing time in HH:MM format. |
| `sameAs` | string | No | URLs of social profiles and other authoritative pages about this firm. |

## Plugin Registration

```typescript
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:

```typescript
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

```javascript
*[_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

```tsx
import { LegalServiceSchema } from 'sanity-plugin-seofields/schema/next'

export default function Page({ data }) {
  return <LegalServiceSchema data={data.schemaOrgLegalService} />
}
```

## JSON-LD Output

```json
{
  "@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"
}
```
