
SEO with Nuxt
Meta tags, useHead, useSeoMeta, structured data, sitemaps, robots.txt, Open Graph, social sharing
1What is the main difference between useHead and useSeoMeta in Nuxt?
What is the main difference between useHead and useSeoMeta in Nuxt?
Answer
useHead is a generic composable for managing all HTML head tags (title, script, link, style, meta), while useSeoMeta is specialized only for SEO meta tags with strict TypeScript typing. useSeoMeta offers better type safety and automatic validation of SEO properties like og:image, twitter:card, while useHead requires manual meta tag configuration. Prefer useSeoMeta for SEO metadata and useHead for other head elements.
2What is a canonical tag and why is it important for SEO?
What is a canonical tag and why is it important for SEO?
Answer
The canonical tag (rel=canonical) tells search engines which is the primary version of a page when multiple URLs have similar or identical content. It prevents duplicate content penalty and consolidates PageRank to the canonical URL. In Nuxt, the canonical tag is automatically generated by default for each page, pointing to the current URL. It can be disabled or customized via useSeoMeta with canonical: false or a specific URL. Essential for sites with pagination, filters, or multilingual versions.
3How to disable indexing of a specific page in Nuxt while allowing crawling?
How to disable indexing of a specific page in Nuxt while allowing crawling?
Answer
Using useSeoMeta with robots: 'noindex, follow' allows crawlers to visit the page and follow links, but prevents indexing in search results. This approach is preferable to robots.txt for already indexed pages, as robots.txt blocks crawling but doesn't remove pages from the index. Alternative: use defineRouteRules with robots: 'noindex' for centralized configuration. To completely block crawling, robots.txt with Disallow is necessary but less flexible per page.
What are the essential Open Graph properties for good social sharing?
How to generate a dynamic sitemap in Nuxt from an external API?
+17 interview questions
Other Vue.js / Nuxt.js interview topics
JavaScript Fundamentals
Modern JavaScript (ES6+)
Vue Basics
Vue Components
Vue Router
Pinia State Management
Vuex (Legacy)
Composition API
Vue Reactivity
Nuxt Fundamentals
Nuxt Data Fetching
Nuxt SSR & SSG
Nuxt Server Routes
Nuxt Modules
Vue Composables
Vue Forms & Validation
Nuxt State Management
Vue Testing
Nuxt Deployment & CI/CD
Vue Performance
Vue Advanced Patterns
TypeScript with Vue
Nuxt Authentication
Nuxt Internationalization
Vue Architecture
Nuxt Security
Vue Ecosystem
Migration Vue 2→3 & Nuxt 2→3
Master Vue.js / Nuxt.js for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free