Skip to main content
seofields
docs

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

FieldTypeRequiredDescription
namestringThe name of the website displayed in search results and knowledge panels.
urlstringThe canonical URL of the website (e.g. https://example.com).
descriptionstringA short description of the website and its purpose.
inLanguagestringThe primary language of the website content (e.g. en, es, fr).
publisherstring | objectThe organization or person that publishes the website — either a URL string or an object with name and logoUrl.
potentialAction.targetstringURL template for the sitelinks search box (e.g. "https://example.com/search?q={search_term_string}"). Enables Google Sitelinks Search Box.
issnstringThe International Standard Serial Number (ISSN) for the website, if applicable.

Plugin Registration

sanity.config.ts
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:

schemas/page.ts
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

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

Next.js Component

app/layout.tsx
import { WebsiteSchema } from 'sanity-plugin-seofields/schema/next'

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

JSON-LD Output

Generated JSON-LD
{
  "@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"
}

Last updated: May 27, 2026. Tested with: Sanity Studio v3, v4, and v5.

Was this page helpful?