---
title: "Infer SEO Meta · Unhead"
canonical_url: "https://unhead.unjs.io/docs/svelte/head/guides/plugins/infer-seo-meta-tags"
last_updated: "2026-07-26T11:30:17.093Z"
meta:
  description: "Auto-generate og:title, og:description, and twitter:card from existing title and description. Reduce duplicate meta tag definitions."
  "og:description": "Auto-generate og:title, og:description, and twitter:card from existing title and description. Reduce duplicate meta tag definitions."
  "og:title": "Infer SEO Meta · Unhead"
---

Home

`
Unhead on GitHub

Switch to SvelteSwitch to TypeScriptSwitch to VueSwitch to ReactSwitch to Solid.jsSwitch to AngularSwitch to Nuxt

**Plugins**

# **Infer SEO Meta**

[Copy for LLMs](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/head/1.guides/plugins/infer-seo-meta-tags.md)

The Infer SEO Meta plugin generates `**og:title**`, `**og:description**`, and `**twitter:card**` from your existing `**title**` and `**description**` tags.

The plugin generates these tags from existing content:

- `**og:title**`: Inferred from your page title
- `**og:description**`: Inferred from your description meta
- `**twitter:card**`: Added as `**summary_large_image**` by default, whether or not `**og:image**` is present

## Generated output

Input

```
useHead({
  title: 'My Page Title',
  meta: [
    { name: 'description', content: 'A description of my page' }
  ]
})
```

Output

```
<title>My Page Title</title>
<meta name="description" content="A description of my page">
<meta property="og:title" content="My Page Title">
<meta property="og:description" content="A description of my page">
<meta name="twitter:card" content="summary_large_image">
```

## Setup

Add the plugin to your Unhead configuration:

Input

```
import { InferSeoMetaPlugin } from '@unhead/svelte/plugins'

const head = createHead({
  plugins: [
    InferSeoMetaPlugin()
  ]
})

// or

head.use(InferSeoMetaPlugin())
```

## Options

The plugin accepts transforms for the generated title and description, plus a Twitter card setting:

Input

```
export interface InferSeoMetaPluginOptions {
  /**
   * Transform the og title.
   *
   * @param title
   */
  ogTitle?: ((title?: string) => string)
  /**
   * Transform the og description.
   *
   * @param description
   */
  ogDescription?: ((description?: string) => string)
  /**
   * The twitter card to use.
   *
   * @deprecated Set this to false and rely on Open Graph metadata instead.
   * @default 'summary_large_image'
   */
  twitterCard?: false | 'summary' | 'summary_large_image' | 'app' | 'player'
}
```

## Customizing the Open Graph title

Remove site name suffix from Open Graph titles:

Input

```
import { InferSeoMetaPlugin } from '@unhead/svelte/plugins'

const head = createHead({
  plugins: [
    InferSeoMetaPlugin({
      ogTitle: (title = '') => title.replace('- My Site', '')
    })
  ]
})
```

## Disabling the Twitter card field

If you don't want Twitter cards generated:

Input

```
InferSeoMetaPlugin({
  twitterCard: false
})
```

## Formatting Open Graph descriptions

Append a call-to-action to your Open Graph descriptions:

Input

```
InferSeoMetaPlugin({
  ogDescription: (description = '') => \`${description} Read the documentation.\`
})
```

## Related

- [**~~useSeoMeta()~~**](https://unhead.unjs.io/docs/head/api/composables/use-seo-meta): Manual SEO meta management
- [**~~Template Params~~**](https://unhead.unjs.io/docs/head/guides/plugins/template-params): Dynamic template parameters

[~~Edit this page~~](https://github.com/unjs/unhead/edit/main/docs/head/1.guides/plugins/infer-seo-meta-tags.md)

[~~Markdown For LLMs~~](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/head/1.guides/plugins/infer-seo-meta-tags.md)

**Did this page help you? **

[**Canonical Plugin** Normalize existing canonical, Open Graph, Twitter, pagination, and related URLs against a configured host.](https://unhead.unjs.io/docs/head/guides/plugins/canonical) [**Minify** Minify inline script and style tag content during SSR rendering. Zero-dependency lightweight minifiers for edge and serverless, with support for custom minifiers.](https://unhead.unjs.io/docs/head/guides/plugins/minify)

**On this page **

- [Generated output](#generated-output)
- [Setup](#setup)
- [Options](#options)
- [Customizing the Open Graph title](#customizing-the-open-graph-title)
- [Disabling the Twitter card field](#disabling-the-twitter-card-field)
- [Formatting Open Graph descriptions](#formatting-open-graph-descriptions)
- [Related](#related)