Meta tags are HTML elements that describe your page to machines. Search engines use them for rankings and snippets. Social platforms use them for link previews.
<head>
<title>My Page · My Site</title>
<meta name="description" content="What this page is about">
<meta property="og:image" content="https://mysite.com/og.png">
</head>
In Vue, you manage these with useSeoMeta() or useHead() from @unhead/vue:
useSeoMeta({
title: 'My Page',
description: 'What this page is about',
ogImage: 'https://mysite.com/og.png'
})
| Meta Tag | Used By | Purpose |
|---|---|---|
<title> | Search engines, browsers | Page title in search results and browser tab |
<meta name="description"> | Search engines | Snippet text in search results (Google rewrites ~70%) |
<meta property="og:*"> | Facebook, LinkedIn, Discord, Slack | Link preview cards |
<meta name="twitter:*"> | Twitter/X | Tweet cards (falls back to OG tags) |
<script type="application/ld+json"> | Search engines | Rich results (stars, FAQs, recipes) |
These affect how your pages appear in Google, Bing, and other search results.
These control link previews when someone shares your URL.
og:title, og:description, og:image.Most sites need just this:
// app.vue or main component
useHead({
title: 'My Site',
titleTemplate: '%s · My Site',
})
useSeoMeta({
ogSiteName: 'My Site',
twitterCard: 'summary_large_image'
})
Then per-component:
<script setup lang="ts">
useSeoMeta({
title: 'About Us',
description: 'We build things.',
ogImage: 'https://mysite.com/about-og.png'
})
</script>
That's it. Twitter falls back to OG tags. Slack uses OG tags. LinkedIn uses OG tags. Don't duplicate unless you need platform-specific content.
When tags conflict, here's what wins:
useSeoMeta() in your componentuseSeoMeta() in your parentUnhead merges these automatically. Child component tags override parent tags.
Forgetting absolute URLs for images
// ❌ Won't work - relative path
ogImage: '/og.png'
// ✅ Works - absolute URL
ogImage: 'https://mysite.com/og.png'
Setting the same description everywhere
Each page needs a unique description. Template descriptions like "Welcome to {page}" are lazy and hurt click-through rates.
Ignoring the preview
Test your meta tags before deploying:
If you're using Nuxt, check out Nuxt SEO which handles much of this automatically.