---
title: "WebSite Schema"
description: "Add Schema.org WebSite structured data to your Sanity-powered site with sanity-plugin-seofields. Improve search appearance with site name, search box, and publisher info."
canonical: https://sanity-plugin-seofields.thehardik.in/docs/schema-org/website
---

# WebSite

The WebSite schema type represents an entire website. It enables search engines to display the site name, sitelinks search box, and publisher information directly in search results.

## About WebSite

The WebSite schema tells search engines the official name of your site, its primary URL, and the organization or person behind it. It can support site identity, SearchAction markup, and clearer knowledge graph relationships. Add it once at the site level as a foundational structured-data entity.

## Fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | Yes | The name of the website displayed in search results and knowledge panels. |
| `url` | string | Yes | The canonical URL of the website (e.g. https://example.com). |
| `description` | string | No | A short description of the website and its purpose. |
| `inLanguage` | string | No | The primary language of the website content (e.g. en, es, fr). |
| `publisher` | string \| object | No | The organization or person that publishes the website — either a URL string or an object with name and logoUrl. |
| `potentialAction.target` | string | No | URL template for the sitelinks search box (e.g. "https://example.com/search?q={search_term_string}"). Enables Google Sitelinks Search Box. |
| `issn` | string | No | The International Standard Serial Number (ISSN) for the website, if applicable. |

## Plugin Registration

```typescript
import { defineConfig } from 'sanity'
import { schemaOrgWebsitePlugin } from 'sanity-plugin-seofields/schema'

export default defineConfig({
  // ... your sanity config
  plugins: [
    schemaOrgWebsitePlugin(),
  ],
})
```

## Schema Usage

Add the `schemaOrgWebsite` field to any document schema:

```typescript
import { defineField, defineType } from 'sanity'

export default defineType({
  name: 'page',
  title: 'Page',
  type: 'document',
  fields: [
    // ... your other fields
    defineField({
      name: 'schemaOrgWebsite',
      title: 'Website Schema',
      type: 'schemaOrgWebsite',
    }),
  ],
})
```

## GROQ Query

```javascript
*[_type == "yourDocument"][0]{
  schemaOrgWebsite {
    name,
    url,
    description,
    inLanguage,
    publisher,
    potentialActionSearch {
      target
    },
    issn
  }
}
```

## Next.js Component

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

export default function Layout({ data }) {
  return <WebsiteSchema data={data.schemaOrgWebsite} />
}
```

## JSON-LD Output

```json
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "My Site",
  "url": "https://example.com",
  "description": "A website about web development and design",
  "inLanguage": "en",
  "publisher": {
    "@type": "Organization",
    "name": "My Company",
    "logo": {
      "@type": "ImageObject",
      "url": "https://example.com/logo.png"
    }
  },
  "potentialAction": {
    "@type": "SearchAction",
    "target": "https://example.com/search?q={search_term_string}",
    "query-input": "required name=search_term_string"
  },
  "issn": "1234-5678"
}
```
