---
title: "Install Unhead Schema.org · Unhead"
meta:
  "og:description": "Add Schema.org to TypeScript apps with @unhead/schema-org. Setup defineWebSite(), defineWebPage() for Google Rich Results."
  "og:title": "Install Unhead Schema.org · Unhead"
  description: "Add Schema.org to TypeScript apps with @unhead/schema-org. Setup defineWebSite(), defineWebPage() for Google Rich Results."
---

**Get Started**

# **Install Unhead Schema.org**

[Copy for LLMs](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/0.typescript/schema-org/guides/get-started/0.installation.md)

Last updated **Jan 19, 2026** by [Harlan Wilton](https://github.com/harlan-zw) in [docs: sync](https://github.com/unjs/unhead/commit/d2f86454774aa60706628b46a850653e1e4d56d9).

**On this page **

- [Demos](#demos)
- [Setup](#setup)
- [Recommended: Tree-shaking for SSR](#recommended-tree-shaking-for-ssr)
- [Optional: Auto-Imports](#optional-auto-imports)
- [Next Steps](#next-steps)

## [Demos](#demos)

[Vite SPA](https://stackblitz.com/edit/vitejs-vite-xbb1fa) [Vite + Vite SSR](https://stackblitz.com/edit/vitejs-vite-vsf3sy)

## [Setup](#setup)

1. Install `@unhead/schema-org` dependency to your project:

```
yarn add -D @unhead/schema-org
```

```
npm install -D @unhead/schema-org
```

```
pnpm add -D @unhead/schema-org
```

1. Configure the Schema.org params

At a minimum you should provide a [**host**](https://developers.google.com/search/docs/advanced/crawling/consolidate-duplicate-urls).

```
import { UnheadSchemaOrg } from '@unhead/schema-org'

useHead({
  templateParams: {
    schemaOrg: {
      host: 'https://example.com',
    }
  }
})
```

See the [**Schema.org Params**](https://unhead.unjs.io/docs/schema-org/guides/core-concepts/params) for all options you can pass on `schemaOrg`.

### [3. Add Site Schema.org](#_3-add-site-schemaorg)

```
useSchemaOrg([
  // @todo Select Identity: http://unhead.unjs.io/schema-org/recipes/identity
  defineWebSite({
    name: 'My Awesome Website',
  }),
  defineWebPage(),
])
```

## [Recommended: Tree-shaking for SSR](#recommended-tree-shaking-for-ssr)

If you're using Vite SSR, it's highly recommended to add the [**Unhead tree-shaking plugin**](https://unhead.unjs.io/docs/head/guides/advanced/vite-plugin).

This will remove the `@unhead/schema-org` dependency from your client bundle, and only include it in your server bundle.

@unhead/schema-org

```
import UnheadVite from '@unhead/addons/vite'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    UnheadVite(),
  ]
})
```

## [Optional: Auto-Imports](#optional-auto-imports)

If you're using Vite with [**unplugin-vue-components**](https://github.com/antfu/unplugin-vue-components) or [**unplugin-auto-import**](https://github.com/antfu/unplugin-auto-import), you can optionally configure automatic imports.

Modify your `vite.config.ts` to get the auto-imports.

```
import { schemaAutoImports, SchemaOrgResolver } from '@unhead/schema-org'

export default defineConfig({
  plugins: [
    // ...
    Components({
      // ...
      resolvers: [
        // auto-import schema-org components
        SchemaOrgResolver(),
      ],
    }),
    AutoImport({
      // ...
      imports: [
        // auto-import schema-org composables
        {
          '@unhead/schema-org': schemaAutoImports,
        },
      ],
    }),
  ]
})
```

```
import { schemaAutoImports, SchemaOrgResolver } from '@unhead/schema-org/vue'

export default defineConfig({
  plugins: [
    // ...
    Components({
      // ...
      resolvers: [
        // auto-import schema-org components
        SchemaOrgResolver(),
      ],
    }),
    AutoImport({
      // ...
      imports: [
        // auto-import schema-org composables
        {
          '@unhead/schema-org/vue': schemaAutoImports,
        },
      ],
    }),
  ]
})
```

## [Next Steps](#next-steps)

Your app is now serving basic Schema.org, congrats! 🎉

The next steps are:

1. Choose an [**Identity**](https://unhead.unjs.io/docs/schema-org/guides/recipes/identity)
2. Set up your pages for [**Schema.org Params**](https://unhead.unjs.io/docs/schema-org/guides/core-concepts/params)
3. Then feel free to follow some recipes:

- [**Breadcrumbs**](https://unhead.unjs.io/docs/schema-org/guides/recipes/breadcrumbs)
- [**FAQ Page**](https://unhead.unjs.io/docs/schema-org/guides/recipes/faq)
- [**Site Search**](https://unhead.unjs.io/docs/schema-org/guides/recipes/site-search)

[Edit this page](https://github.com/unjs/unhead/edit/main/docs/0.typescript/schema-org/guides/get-started/0.installation.md)

[Markdown For LLMs](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/0.typescript/schema-org/guides/get-started/0.installation.md)

**Did this page help you? **

[**Streaming** Stream head tags as async content resolves during server-side rendering](https://unhead.unjs.io/docs/typescript/head/guides/core-concepts/streaming) [**Installation** Set up Unhead in Vue with createHead() and app.use(). Full SSR support with transformHtmlTemplate(). Works with Vue 3 and Vite.](https://unhead.unjs.io/docs/vue/head/guides/get-started/installation)

**On this page **

- [Demos](#demos)
- [Setup](#setup)
- [Recommended: Tree-shaking for SSR](#recommended-tree-shaking-for-ssr)
- [Optional: Auto-Imports](#optional-auto-imports)
- [Next Steps](#next-steps)