Meta robots tags control how search engines handle individual pages. While robots.txt provides site-wide rules, meta robots tags are crucial for precise page-level control over indexing and crawling behavior.
✅ Good for:
❌ Don't use for:
Add meta robots tags to your Nuxt pages using Unhead composables:
useSeoMeta({
robots: 'noindex, follow'
})
useSeoMeta({
robots: 'index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1'
})
useSeoMeta({
robots: `index, follow, unavailable_after: ${new Date('2024-12-31').toISOString()}`
})
Meta robots tags consist of directives that tell search engines how to handle your page. They're implemented as a meta tag in your page's head:
<meta name="robots" content="index, follow">
index/noindex: Allow/prevent page in search resultsfollow/nofollow: Allow/prevent following links on pagenoarchive: Prevent cached copiesnosnippet: Prevent search result snippetsmax-snippet: Control snippet lengthmax-image-preview: Control image preview sizemax-video-preview: Control video preview lengthunavailable_after: Schedule search removal dateFor a complete list of directives and their behaviors, see Google's meta robots documentation.
<head>googlebot instead of robots)useSeoMeta({
robots: 'noindex, follow',
// Learn more about canonical URLs at /learn-seo/nuxt/controlling-crawlers/canonical-urls
canonical: 'https://mysite.com/search' // point to main search page
})
const { query } = useRoute()
useSeoMeta({
// Block indexing if filters are applied
robots: Object.keys(query).length > 0 ? 'noindex, follow' : 'index, follow',
canonical: `https://mysite.com/products/${category}` // point to main category
})
See handling pagination in Nuxt for more comprehensive pagination strategies.
const endDate = new Date('2024-12-31')
useSeoMeta({
robots: `index, follow, unavailable_after: ${endDate.toISOString()}`
})
For permanent content changes, consider using HTTP redirects instead.
useSeoMeta({
// Prevent caching and limit snippets
robots: 'index, follow, noarchive, max-snippet:50'
})
For sensitive user content, review our security guide.
See Google's guide on robots.txt testing for detailed steps.
<head>