entries:resolve Hook · Unhead

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

- [Docs](https://unhead.unjs.io/docs/typescript/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/typescript/head/guides/get-started/overview)

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

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

TypeScript

- [Switch to TypeScript](https://unhead.unjs.io/docs/typescript/head/api/hooks/entries-resolve)
- [Switch to Vue](https://unhead.unjs.io/docs/vue/head/api/hooks/entries-resolve)
- [Switch to React](https://unhead.unjs.io/docs/react/head/api/hooks/entries-resolve)
- [Switch to Svelte](https://unhead.unjs.io/docs/svelte/head/api/hooks/entries-resolve)
- [Switch to Solid.js](https://unhead.unjs.io/docs/solid-js/head/api/hooks/entries-resolve)
- [Switch to Angular](https://unhead.unjs.io/docs/angular/head/api/hooks/entries-resolve)
- [Switch to Nuxt](https://unhead.unjs.io/docs/nuxt/head/api/hooks/entries-resolve)

v3 (stable)

Head

- [Discord Support](https://discord.com/invite/275MBUBvgP)
- [TypeScript Playground](https://stackblitz.com/edit/github-hhxywsb5)

- Get Started
  - [Overview](https://unhead.unjs.io/docs/typescript/head/api/get-started/overview)
- Composables
  - [`useHead()`](https://unhead.unjs.io/docs/typescript/head/api/composables/use-head)
  - [`useHeadSafe()`](https://unhead.unjs.io/docs/typescript/head/api/composables/use-head-safe)
  - [`useSeoMeta()`](https://unhead.unjs.io/docs/typescript/head/api/composables/use-seo-meta)
  - [`useScript()`](https://unhead.unjs.io/docs/typescript/head/api/composables/use-script)
- Hooks
  - [entries:updated](https://unhead.unjs.io/docs/typescript/head/api/hooks/entries-updated)
  - [entries:resolve](https://unhead.unjs.io/docs/typescript/head/api/hooks/entries-resolve)
  - [entries:normalize](https://unhead.unjs.io/docs/typescript/head/api/hooks/entries-normalize)
  - [tag:normalise](https://unhead.unjs.io/docs/typescript/head/api/hooks/tag-normalise)
  - [tags:beforeResolve](https://unhead.unjs.io/docs/typescript/head/api/hooks/tags-before-resolve)
  - [tags:resolve](https://unhead.unjs.io/docs/typescript/head/api/hooks/tags-resolve)
  - [tags:afterResolve](https://unhead.unjs.io/docs/typescript/head/api/hooks/tags-after-resolve)
  - [dom:beforeRender](https://unhead.unjs.io/docs/typescript/head/api/hooks/dom-before-render)
  - [ssr:beforeRender](https://unhead.unjs.io/docs/typescript/head/api/hooks/ssr-before-render)
  - [ssr:render](https://unhead.unjs.io/docs/typescript/head/api/hooks/ssr-render)
  - [ssr:rendered](https://unhead.unjs.io/docs/typescript/head/api/hooks/ssr-rendered)
  - [script:updated](https://unhead.unjs.io/docs/typescript/head/api/hooks/script-updated)
- [Plugins](https://unhead.unjs.io/docs/head/api/plugins)

Hooks

# entries:resolve Hook

[Copy for LLMs](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/head/7.api/hooks/03.entries-resolve.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

- [Lifecycle Position](#lifecycle-position)
- [Hook Signature](#hook-signature)
- [Usage Example](#usage-example)
- [Use Cases](#use-cases)

The `entries:resolve` hook is called when head entries need to be resolved into tags. This hook provides access to both the entries and the tags being generated, allowing you to modify or add to the collection before the final tag resolution process.

## [Lifecycle Position](#lifecycle-position)

This hook runs after [`entries:updated`](https://unhead.unjs.io/docs/head/api/hooks/entries-updated) and before [`entries:normalize`](https://unhead.unjs.io/docs/head/api/hooks/entries-normalize).

## [Hook Signature](#hook-signature)

```
export interface Hook {
  'entries:resolve': (ctx: EntryResolveCtx<any>) => HookResult
}
```

### [Parameters](#parameters)

| Name | Type | Description |
| --- | --- | --- |
| `ctx` | `EntryResolveCtx<any>` | Context containing the entries and tags being processed |

The `EntryResolveCtx` interface is defined as:

```
interface EntryResolveCtx<T> {
  tags: HeadTag[]
  entries: HeadEntry<T>[]
}
```

### [Returns](#returns)

`HookResult` which is either `void` or `Promise<void>`

## [Usage Example](#usage-example)

```
import { createHead } from 'unhead'

const head = createHead({
  hooks: {
    'entries:resolve': (ctx) => {
      // Inspect the entries being processed
      console.log(\`Processing ${ctx.entries.length} head entries\`)

      // You can modify or add to the tags collection
      ctx.tags.push({
        tag: 'meta',
        props: {
          name: 'generator',
          content: 'Unhead'
        }
      })
    }
  }
})
```

## [Use Cases](#use-cases)

### [Adding Global Meta Tags](#adding-global-meta-tags)

Use this hook to add global meta tags that should be present on all pages:

```
import { defineHeadPlugin } from 'unhead'

export const globalMetaPlugin = defineHeadPlugin({
  hooks: {
    'entries:resolve': (ctx) => {
      // Add global meta tags
      ctx.tags.push(
        {
          tag: 'meta',
          props: {
            name: 'author',
            content: 'Your Company'
          }
        },
        {
          tag: 'meta',
          props: {
            property: 'og:site_name',
            content: 'Your Application'
          }
        }
      )
    }
  }
})
```

### [Extracting Information from Entries](#extracting-information-from-entries)

You can use this hook to extract and process information from entries:

```
import { defineHeadPlugin } from 'unhead'

export const analyticsDataPlugin = defineHeadPlugin({
  hooks: {
    'entries:resolve': (ctx) => {
      // Extract all page titles and descriptions for analytics
      const pageData = ctx.entries.reduce((acc, entry) => {
        const input = entry.input
        if (typeof input === 'object') {
          if ('title' in input) {
            acc.title = input.title
          }

          if ('meta' in input && Array.isArray(input.meta)) {
            const descMeta = input.meta.find(m =>
              m.name === 'description' || m.property === 'og:description'
            )
            if (descMeta) {
              acc.description = descMeta.content
            }
          }
        }
        return acc
      }, {})

      // Use the extracted data
      if (!ctx.entries[0].options.ssr) {
        logPageView(pageData)
      }
    }
  }
})

function logPageView(data) {
  // Send data to analytics service
  console.log('Logging page view:', data)
}
```

[Edit this page](https://github.com/unjs/unhead/edit/main/docs/head/7.api/hooks/03.entries-resolve.md)

[Markdown For LLMs](https://raw.githubusercontent.com/unjs/unhead/refs/heads/main/docs/head/7.api/hooks/03.entries-resolve.md)

Did this page help you?

[entries:updated Hook triggered when head entries change. Track title updates, log changes, and react to modifications in your head configuration.](https://unhead.unjs.io/docs/head/api/hooks/entries-updated) [entries:normalize Hook for normalizing individual head entries. Add entry-specific attributes, conditional modifications, and template processing.](https://unhead.unjs.io/docs/head/api/hooks/entries-normalize)

On this page

- [Lifecycle Position](#lifecycle-position)
- [Hook Signature](#hook-signature)
- [Usage Example](#usage-example)
- [Use Cases](#use-cases)

[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/typescript/head/guides/get-started/overview)
- [useHead](https://unhead.unjs.io/docs/typescript/head/api/composables/use-head)
- [useSeoMeta](https://unhead.unjs.io/docs/typescript/head/api/composables/use-seo-meta)
- [useHeadSafe](https://unhead.unjs.io/docs/typescript/head/api/composables/use-head-safe)
- [useScript](https://unhead.unjs.io/docs/typescript/head/api/composables/use-script)

### Schema.org

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

### Guides

- [Titles](https://unhead.unjs.io/docs/typescript/head/guides/core-concepts/titles)
- [Streaming SSR](https://unhead.unjs.io/docs/typescript/head/guides/core-concepts/streaming)
- [DOM Events](https://unhead.unjs.io/docs/typescript/head/guides/core-concepts/dom-event-handling)
- [Plugins](https://unhead.unjs.io/docs/typescript/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)