Meta Descriptions in Vue & Nuxt
Introduction
Meta descriptions don't directly impact rankings, however, they can influence click-through rates by giving users context about your page's content.
<meta name="description" content="Learn how to implement meta descriptions in Vue & Nuxt. Includes reactive content, SEO best practices, and social sharing tips.">
Unlike page titles, descriptions have more flexibility but require careful crafting to be effective.
Quick Tips
- They're not essential: Google often rewrites them ~70% of the time, pulling from your page content instead.
- Length Is Dynamic: Google's display length changes based on device and query. Focus on clarity over arbitrary character count.
- Templates Are Bad: Using templates for descriptions like "Buy {product} at great prices" is lazy and will hurt click-through rates, summarize using AI tools, if you're short on time.
Implementation in Vue / Nuxt
In Vue, we use the built-in head package called Unhead.
useSeoMeta({
description: 'Your description here'
})
Or with useHead()
if you prefer:
useHead({
meta: [
{ name: 'description', content: 'Your description here' }
]
})
Reactive Descriptions
Use async data with refs for dynamic descriptions:
<script setup lang="ts">
const { data: post } = await useAsyncData(() => fetchPost())
useSeoMeta({
// computer getter syntax
description: () => post.value.description
})
</script>
'og:description'
Open Graph Description
The following social sites are known to use the og:description
tag for descriptions: Facebook, LinkedIn, Discord, Slack.
Twitter (X) no longer uses the twitter:description
tag, so it's not worth setting.
useSeoMeta({
description: 'Technical description for search',
ogDescription: 'More casual description for social sharing',
// Don't bother with Twitter description, it won't be shown
})
If you're too lazy to generate two descriptions, you can use the same description
field for both. Nuxt SEO Utils can handle this for you.
You can verify your social og descriptions using the following tools:
- Facebook: Sharing Debugger
- Twitter: Card Validator
- LinkedIn: Post Inspector
Titles
Learn how to master page titles in Vue & Nuxt using useHead, title templates, and SEO best practices. Includes reactive titles, social sharing, and template params.
Open Graph Tags
Cut through the noise of Open Graph tags. Learn what actually matters for social sharing, what you can skip, and how to implement them properly in Vue.