Infer SEO Meta · Unhead

[Unhead Home](https://unhead.unjs.io/ "Home")

- [Docs](https://unhead.unjs.io/docs/solid-js/head/guides/get-started/overview)
- [Tools](https://unhead.unjs.io/tools)
- [Learn](https://unhead.unjs.io/learn/guides/what-is-capo)

[Releases](https://unhead.unjs.io/releases)

Search…```k`` /`

[Unhead on GitHub](https://github.com/unjs/unhead)

[User Guides](https://unhead.unjs.io/docs/solid-js/head/guides/get-started/overview)

[API](https://unhead.unjs.io/docs/solid-js/head/api/get-started/overview)

[Releases](https://unhead.unjs.io/docs/solid-js/releases/v3)

Solid.js

- [Switch to Solid.js](https://unhead.unjs.io/docs/solid-js/head/guides/plugins/infer-seo-meta-tags)
- [Switch to TypeScript](https://unhead.unjs.io/docs/typescript/head/guides/plugins/infer-seo-meta-tags)
- [Switch to Vue](https://unhead.unjs.io/docs/vue/head/guides/plugins/infer-seo-meta-tags)
- [Switch to React](https://unhead.unjs.io/docs/react/head/guides/plugins/infer-seo-meta-tags)
- [Switch to Svelte](https://unhead.unjs.io/docs/svelte/head/guides/plugins/infer-seo-meta-tags)
- [Switch to Angular](https://unhead.unjs.io/docs/angular/head/guides/plugins/infer-seo-meta-tags)
- [Switch to Nuxt](https://unhead.unjs.io/docs/nuxt/head/guides/plugins/infer-seo-meta-tags)

v3 (stable)

Head

- [Discord Support](https://discord.com/invite/275MBUBvgP)

- Get Started
  - [Overview](https://unhead.unjs.io/docs/solid-js/head/guides/get-started/overview)
  - [Introduction to Unhead](https://unhead.unjs.io/docs/solid-js/head/guides/get-started/intro-to-unhead)
  - [Starter Recipes](https://unhead.unjs.io/docs/solid-js/head/guides/get-started/starter-recipes)
  - [Installation](https://unhead.unjs.io/docs/solid-js/head/guides/get-started/installation)
  - [Upgrade Guide](https://unhead.unjs.io/docs/solid-js/head/guides/get-started/migration)
- Core Concepts
  - [Titles & Title Templates](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/titles)
  - [Tag Sorting & Placement](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/positions)
  - [Class & Style Attributes](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/class-attr)
  - [Inline Style & Scripts](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/inner-content)
  - [Tag Deduplication](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/handling-duplicates)
  - [DOM Event Handling](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/dom-event-handling)
  - [Script Loading](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/loading-scripts)
  - [Reactivity](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/reactivity)
  - [StreamingNew](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/streaming)
- Build Plugins
  - [Overview](https://unhead.unjs.io/docs/solid-js/head/guides/build-plugins/overview)
  - [Tree-Shaking](https://unhead.unjs.io/docs/solid-js/head/guides/build-plugins/tree-shaking)
  - [useSeoMeta Transform](https://unhead.unjs.io/docs/solid-js/head/guides/build-plugins/seo-meta-transform)
  - [Minify Transform](https://unhead.unjs.io/docs/solid-js/head/guides/build-plugins/minify-transform)
  - [Devtools](https://unhead.unjs.io/docs/solid-js/head/guides/build-plugins/devtools)
- Plugins
  - [Template Params](https://unhead.unjs.io/docs/solid-js/head/guides/plugins/template-params)
  - [Alias Sorting](https://unhead.unjs.io/docs/solid-js/head/guides/plugins/alias-sorting)
  - [Canonical Plugin](https://unhead.unjs.io/docs/solid-js/head/guides/plugins/canonical)
  - [Infer SEO Meta](https://unhead.unjs.io/docs/solid-js/head/guides/plugins/infer-seo-meta-tags)
  - [Minify](https://unhead.unjs.io/docs/solid-js/head/guides/plugins/minify)
  - [Validate](https://unhead.unjs.io/docs/solid-js/head/guides/plugins/validate)

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)

Last updated Apr 9, 2026 by [Harlan Wilton](https://github.com/harlan-zw) in [refactor(bundler)!: named Unhead export, ctx-based transforms, dev-mode validate (#733)](https://github.com/unjs/unhead/pull/733).

On this page

- [What Does This Plugin Do?](#what-does-this-plugin-do)
- [How Does the Output Look?](#how-does-the-output-look)
- [How Do I Set Up the Plugin?](#how-do-i-set-up-the-plugin)
- [What Options Can I Configure?](#what-options-can-i-configure)
- [How Do I Customize the OG Title?](#how-do-i-customize-the-og-title)
- [How Do I Disable Twitter Cards?](#how-do-i-disable-twitter-cards)
- [How Do I Format OG Descriptions?](#how-do-i-format-og-descriptions)
- [Related](#related)

**Quick Answer:** The Infer SEO Meta plugin automatically generates `og:title`, `og:description`, and `twitter:card` from your existing `title` and `description` tags, reducing duplicate meta tag definitions.

## [What Does This Plugin Do?](#what-does-this-plugin-do)

The Infer SEO Meta plugin automatically generates Open Graph and Twitter meta tags from your existing content:

- `og:title` - Inferred from your page title
- `og:description` - Inferred from your description meta
- `twitter:card` - Set automatically when using `og:image`

Use this plugin when you want to avoid duplicating your page title and description across Open Graph and Twitter meta tags. It's ideal for sites that need consistent social sharing metadata without manual repetition.

## [How Does the Output Look?](#how-does-the-output-look)

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

## [How Do I Set Up the Plugin?](#how-do-i-set-up-the-plugin)

Add the plugin to your Unhead configuration:

Input

```
import { InferSeoMetaPlugin } from '@unhead/solid-js/plugins'

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

// or

head.use(InferSeoMetaPlugin())
```

## [What Options Can I Configure?](#what-options-can-i-configure)

You can customize how the plugin transforms your content:

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.
   *
   * @default 'summary_large_image'
   */
  twitterCard?: false | 'summary' | 'summary_large_image' | 'app' | 'player'
}
```

## [How Do I Customize the OG Title?](#how-do-i-customize-the-og-title)

Remove site name suffix from Open Graph titles:

Input

```
import { InferSeoMetaPlugin } from '@unhead/solid-js/plugins'

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

## [How Do I Disable Twitter Cards?](#how-do-i-disable-twitter-cards)

If you don't want Twitter cards generated:

Input

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

## [How Do I Format OG Descriptions?](#how-do-i-format-og-descriptions)

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

Input

```
InferSeoMetaPlugin({
  ogDescription: description => \`${description} Learn more now!\`
})
```

## [Related](#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 Auto-generate canonical URLs and convert relative paths to absolute. Required for og:image, twitter:image, and SEO canonical links.](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

- [What Does This Plugin Do?](#what-does-this-plugin-do)
- [How Does the Output Look?](#how-does-the-output-look)
- [How Do I Set Up the Plugin?](#how-do-i-set-up-the-plugin)
- [What Options Can I Configure?](#what-options-can-i-configure)
- [How Do I Customize the OG Title?](#how-do-i-customize-the-og-title)
- [How Do I Disable Twitter Cards?](#how-do-i-disable-twitter-cards)
- [How Do I Format OG Descriptions?](#how-do-i-format-og-descriptions)
- [Related](#related)

[GitHub](https://github.com/unjs/unhead) [ Discord](https://discord.com/invite/275MBUBvgP)

[ /llms.txt](https://unhead.unjs.io/llms.txt)

[Part of the UnJS ecosystem](https://unjs.io/)

### Head Management

- [Getting Started](https://unhead.unjs.io/docs/solid-js/head/guides/get-started/overview)
- [useHead](https://unhead.unjs.io/docs/solid-js/head/api/composables/use-head)
- [useSeoMeta](https://unhead.unjs.io/docs/solid-js/head/api/composables/use-seo-meta)
- [useHeadSafe](https://unhead.unjs.io/docs/solid-js/head/api/composables/use-head-safe)
- [useScript](https://unhead.unjs.io/docs/solid-js/head/api/composables/use-script)

### Schema.org

- [Getting Started](https://unhead.unjs.io/docs/solid-js/schema-org/guides/get-started/overview)
- [useSchemaOrg](https://unhead.unjs.io/docs/solid-js/schema-org/api/composables/use-schema-org)
- [Nodes](https://unhead.unjs.io/docs/solid-js/schema-org/guides/core-concepts/nodes)
- [Recipes](https://unhead.unjs.io/docs/solid-js/schema-org/guides/recipes/identity)

### Guides

- [Titles](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/titles)
- [Streaming SSR](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/streaming)
- [DOM Events](https://unhead.unjs.io/docs/solid-js/head/guides/core-concepts/dom-event-handling)
- [Plugins](https://unhead.unjs.io/docs/solid-js/head/guides/plugins/template-params)

### Tools

- [Meta Tag Generator](https://unhead.unjs.io/tools/meta-tag-generator)
- [OG Image Generator](https://unhead.unjs.io/tools/og-image-generator)
- [Schema.org Generator](https://unhead.unjs.io/tools/schema-generator)
- [Capo.js Analyzer](https://unhead.unjs.io/tools/capo-analyzer)

### Articles

- [What is Capo.js?](https://unhead.unjs.io/learn/guides/what-is-capo)

### Research

- [State of <head> in 2026](https://unhead.unjs.io/learn/research/state-of-head-2026)
- [Streaming Head Performance](https://unhead.unjs.io/learn/research/streaming-head-performance)
- [Capo.js Performance Research](https://unhead.unjs.io/learn/research/capo-performance-research)

Copyright © 2025-2026 Harlan Wilton - [MIT License](https://github.com/unjs/unhead/blob/main/license)