Technical SEO

Vue SEO: Rendering Modes, Routing, and the Metadata That Arrives Too Late

· · 21 min read · Updated 28 November 2026

Vue Router optimization for SEO comes down to three decisions: render the routes that need to rank on the server or at build time, use history mode (createWebHistory()) with real links and real status codes, and put each route’s title, description and canonical into the HTML the server sends. Everything else is tuning. Vue is unusually candid about this in its own documentation: it says plainly that Vue.js is a framework for building client-side applications, names the exact case where client rendering breaks, and tells you which routing mode damages search visibility. Most Vue SEO problems are therefore documented trade-offs that nobody on the team read.

This is the Vue instalment of the SEO for engineers series, under the general JavaScript SEO guide. Every source below was checked against its live page on 26 November 2026.

Vue SEO is the work of getting a Vue application’s content, titles and structured data into the HTML response the server sends, by prerendering routes at build time, server-rendering them per request, or leaving them client-rendered where nothing needs to rank, and then verifying that a crawler reading that response before any JavaScript runs actually receives the page.

Key takeaways

  • Vue renders in the browser by default. A route whose content is fetched after mount is, to a crawler that does not run JavaScript, a page with a spinner.
  • Hash routing is the one unambiguous mistake. vue-router documents createWebHistory() as the recommended mode and says hash mode has a bad impact on SEO.
  • AI crawlers read only the raw response. Vercel’s analysis found none of the major AI crawlers currently render JavaScript, including GPTBot, ClaudeBot and PerplexityBot.
  • The HTML5-mode fallback creates soft 404s. Every unknown URL returns your app shell with a 200 until you return a real 404.
  • Route meta is where SEO data belongs. Keep title, description and indexability on the route record, and render them on the server, not in an afterEach hook.

Is Vue bad for SEO?

No. The useful version of that answer sits in Vue’s own documentation, not in an SEO tool.

Vue draws the line at synchronous versus asynchronous content. Its SSR guide says Google and Bing index synchronous JavaScript applications fine, then adds the qualifier that matters: “Synchronous being the key word there. If your app starts with a loading spinner, then fetches content via Ajax, the crawler will not wait for you to finish.” That describes nearly every real Vue application. Components mount, an effect fires, data arrives, the page assembles. By then the crawler may have moved on.

So the accurate framing is not “Vue apps do not rank.” It is that a Vue route whose content is fetched after mount looks, from a crawler’s position, like a page containing a spinner. Everything below is about moving the moment of assembly earlier, to build time or to the server, for the routes where that matters.

It matters more than it used to, because the crawler population has changed. Googlebot renders JavaScript in a deferred step: Google says a page may stay on this queue for a few seconds, but it can take longer. A client-rendered Vue route can still be indexed, late and sometimes partially.

AI crawlers are a different story. Vercel’s December 2024 study of its own network found that none of the major AI crawlers render JavaScript, naming OpenAI’s GPTBot, OAI-SearchBot and ChatGPT-User, Anthropic’s ClaudeBot and PerplexityBot among them. For those engines a client-rendered route is not slow to appear. It is not there at all.

The ten-second check

Before choosing a rendering strategy, find out what you currently ship. Fetch a route the way a crawler does, with no browser involved:

curl -s https://example.com/pricing | grep -iE "<h1|<title"

If your heading and a route-specific title come back, that route is already server-rendered or prerendered. If you get <div id="app"></div> and a script tag, you have found the problem.

Then run it again as an AI crawler, because that is the exact response GPTBot reads:

curl -sA "GPTBot" https://example.com/pricing | grep -i "<h1"

Run this per route, not per site. Vue applications are routinely mixed, with a prerendered marketing site attached to a client-rendered product area. A single spot check on the homepage tells you nothing about the pages that actually need to rank.

Four rendering modes, and how to choose per route

Vue supports all four. The choice belongs to the route, not to the application.

Static generation (SSG): the default answer for content

Render each route once at build time and serve the resulting HTML as a file. Vue says SSG keeps the time-to-content performance of SSR while being cheaper and easier to deploy, because the output is static HTML and assets.

The constraint is in Vue’s wording: SSG “can only be applied to pages providing static data, i.e. data that is known at build time and can not change between requests.” Every data change needs a new deployment.

For a marketing site, documentation or a blog, that constraint costs nothing. Vue is direct about it: if you are only investigating SSR to improve the SEO of a handful of marketing pages, you probably want SSG instead. This is the option most teams skip because it sounds too modest to fix a real problem.

Server-side rendering (SSR): for per-request data

Render on the server per request, send complete HTML, then hydrate in the browser. Vue lists three benefits: faster time-to-content, a unified mental model, and better SEO, because the crawlers see the fully rendered page.

It also lists three costs that teams routinely discover late. Browser-specific code can only live in certain lifecycle hooks. The build and deployment need an environment where Node.js can run. And rendering a full app in Node is more CPU-intensive than serving static files.

Vue’s own recommendation is to use a Vue framework if you need SSR, because frameworks often have built-in support. In practice that usually means Nuxt; the rendering-mode and head-management specifics are in Nuxt SEO.

Selective prerendering: the retrofit

If migrating the whole application is not on the roadmap, prerender only the routes that need to rank and leave the rest client-rendered. This pattern is covered in detail in single-page application SEO. It is the right first move for a shipped product with a marketing surface attached to it.

Client-side rendering: for everything behind a login

The default, and entirely correct for the logged-in application. No crawler needs your dashboard. Choosing CSR on purpose for those routes is not a compromise; it is what keeps the other three options small.

SSGSSRSelective prerenderCSR
Data freshnessPer deployPer requestPer deployPer request, in browser
InfrastructureStatic hostNode serverBuild stepStatic host
Googlebot sees contentYesYesOn chosen routesAfter rendering, if it renders
AI crawlers see contentYesYesOn chosen routesNo
Right forMarketing, docs, blogPer-request dataRetrofitting a shipped SPAAuthenticated app

Vue Router optimization for SEO

Rendering gets content into the response. The router decides whether there is a distinct, linkable, correctly coded response to get it into. These are the router settings that change what a search engine sees, in the order I would check them.

1. Use HTML5 history mode, never hash mode

vue-router offers three history modes. createWebHistory() produces normal paths and is the recommended mode. createWebHashHistory() puts the route after a #. In the docs’ words, that part of the URL “is never sent to the server”, and “It does however have a bad impact in SEO.”

That is the framework’s own assessment, and Google agrees from the other side: don’t use fragments to change page content, as Google Search generally doesn’t support URL fragments. A public Vue app on hash routing has, from a crawler’s position, one page.

The third mode, createMemoryHistory(), does not touch the URL at all. It is for Node environments: you use it inside SSR, not instead of HTML5 mode.

import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(),
  strict: true,
  routes,
})

Google can only discover links that are <a> HTML elements with an href attribute. A click handler that calls router.push() works for a user and is invisible to a crawler.

RouterLink is the fix, because it renders an anchor with a resolved href while letting Vue Router change the URL without reloading the page. The trap is the custom prop, which stops it wrapping its content in an <a> tag. If you use it, render the anchor yourself.

<!-- Crawlable: renders <a href="/pricing"> -->
<RouterLink to="/pricing">Pricing</RouterLink>

<!-- Not crawlable: no href for Google to follow -->
<span class="nav-item" @click="router.push('/pricing')">Pricing</span>

Navigation menus, pagination, filters and “load more” buttons are where this breaks most often. A route nobody links to with a real href is an orphan, however well it renders; the internal linking audit method finds them.

3. Keep SEO data on the route record

vue-router lets you attach arbitrary data to a route through meta, and route.meta is a non-recursive merge of all meta fields from parent to child. That makes the route record the natural home for a title, a description and an indexability flag, with a parent route like /app setting index: false once for everything beneath it.

const routes = [
  {
    path: '/pricing',
    component: () => import('./views/PricingPage.vue'),
    meta: { title: 'Pricing | Acme', description: 'Plans and prices for Acme.' },
  },
  {
    path: '/app',
    component: () => import('./views/AppShell.vue'),
    meta: { index: false },
    children: [],
  },
]

The common way to apply it is a global after hook. vue-router lists changing the title of the page among the uses of router.afterEach, and for the user it works. For SEO it is the wrong layer: afterEach runs in the browser after navigation, so the title it sets never reaches a crawler on a client-rendered route. Read the route meta from your head manager instead, as shown in the metadata section below, so the same values render on the server.

Google’s title guidance asks you to avoid repeated or boilerplate text in titles. One shell title across 200 routes is exactly that.

4. Pick one trailing-slash and case policy

By default, Vue Router routes are case-insensitive and match routes with or without a trailing slash. That is friendly for users and bad for duplicates: /pricing, /pricing/ and /Pricing all render the same page as a normal, successful response.

Google treats each URL above separately (and equally), so three working variants are three URLs competing for one page. Pick one form, set strict: true (and sensitive: true if you want case enforced) so the router agrees with you, and 301 the other variants at the server or CDN. The router cannot send a 301; only the server can. The canonical on each page should name the same form, as covered in canonical tags.

5. Redirect on the server, and canonicalise aliases

A redirect in the route table replaces the URL in the browser. It is a client-side redirect, so the server still answered the old URL as a normal page. Google’s guidance is to only use JavaScript redirects if you can’t do server-side or meta refresh redirects, and it warns that Google might never see a JavaScript redirect if rendering fails.

My rule: when a URL moves for good, add the 301 at the server or host, and keep the router redirect only so in-app links keep working.

An alias is different: the URL stays and renders the same component. vue-router’s own note is blunt: when using aliases, make sure to define canonical links. Otherwise you have published a duplicate on purpose.

6. Return real 404s, not soft ones

History mode needs a server fallback that serves index.html for any URL that is not a file: try_files $uri $uri/ /index.html; on nginx, /* /index.html 200 in a Netlify _redirects file. Then comes the caveat vue-router states plainly: Your server will no longer report 404 errors as all not-found paths now serve up index.html.

That produces a soft 404 for every typo’d URL, dead external link and stale path: each one returns HTTP 200 with your app shell, which wastes crawl attention on pages that do not exist.

A catch-all route such as { path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound } fixes what the human sees. It does not change the status code, which the server decided before Vue ran. The fix depends on how the route is rendered:

  • SSR: resolve the route on the server before rendering and set the status from the match.
  • Static host: configure a hosting-level 404 for paths the build did not generate.
  • Pure CSR: Google documents two options: a JavaScript redirect to a URL that returns a real 404, or a noindex robots meta tag added to the error view.
// SSR entry: match the URL with the router, then set the status
await router.push(req.originalUrl)
await router.isReady()
const notFound = router.currentRoute.value.name === 'NotFound'
res.status(notFound ? 404 : 200)

Which pages should return a not-found status, and which should redirect or canonicalise instead, is a separate decision covered in canonical vs noindex.

7. Lazy-load route components

vue-router supports dynamic imports out of the box, and its guidance is that it is a good idea to always use dynamic imports for all your routes. Each route becomes its own chunk, so a visitor landing on /pricing does not download the code for the whole dashboard.

This is a performance setting, not an indexing one, but it lands on the same Core Web Vitals you are measured on. One documented warning: do not use async components as route components. The route’s component should just be a function returning the import.

Metadata that arrives too late

The pattern is the same across every client-rendered framework, and so is the Search Console symptom: one title, repeated across the whole site.

A Vue app has a single index.html with one <title> and one meta description. Per-route metadata is applied by JavaScript after the router resolves. On a client-rendered route, a crawler that does not render reads the response before any of that runs, so what it indexes is whatever the shell contained, usually the app’s name.

Google does accept JavaScript-set metadata: it says you can set or change the meta description as well as the <title> element with JavaScript, provided rendering happens. It is less relaxed about the canonical tag; Google says it does not recommend using JavaScript for that. And neither applies to AI crawlers, which never run the script.

Head-management libraries do not change the timing on their own. They set the head correctly; the question is whether they run before or after the response is sent. With Unhead, the head library Nuxt uses, an SSR setup creates a fresh instance from @unhead/vue/server for each request and writes the head into the HTML template. Unhead v2 and later do not support Vue 2, which needs @unhead/vue@^1.

Wire it to the route meta from section 3 so the router stays the single source of truth:

import { computed } from 'vue'
import { useRoute } from 'vue-router'
import { useHead } from '@unhead/vue'

const route = useRoute()
const SITE_URL = import.meta.env.VITE_SITE_URL

useHead({
  title: computed(() => route.meta.title ?? 'Acme'),
  meta: [
    { name: 'description', content: computed(() => route.meta.description ?? '') },
    { name: 'robots', content: computed(() => (route.meta.index === false ? 'noindex' : 'index, follow')) },
  ],
  link: [{ rel: 'canonical', href: computed(() => new URL(route.path, SITE_URL).href) }],
})

On a prerendered or server-rendered route, that produces the right head in the HTML. On a client-rendered route, it still runs in the browser, too late for anything that does not render.

The same timing rule covers structured data. JSON-LD appended inside onMounted is invisible to anything reading the raw response, and onMounted is one of the hooks Vue does not call during SSR. Emit schema into the server-produced HTML instead; the types worth the effort are in structured data for AI search.

The SSR traps Vue documents, and teams still hit

Vue’s SSR guide has a section called Writing SSR-friendly Code. It is short and accurate, and reading it before a migration saves a week. The traps that recur most:

1. Lifecycle hooks that never fire. Vue states that mounted/onMounted and updated/onUpdated will NOT be called during SSR; only beforeCreate and created run on the server. A data fetch living in onMounted does not run during server rendering, so the server emits the empty state. This is the most common way an SSR migration ships and changes nothing a crawler can see.

2. Browser globals at module scope. Universal code cannot assume access to platform-specific APIs. window or document referenced outside a client-only hook throws in Node. The refactor this implies is usually the real cost of an SSR migration, not the rendering itself.

3. Cross-request state pollution. A store declared at a module’s root scope becomes a singleton. In the browser that is fine. On a server, the same module instances are reused across requests, so one user’s state can leak into another user’s response. Vue calls this cross-request state pollution; the fix is a new app instance, router and store per request. It is a privacy bug before it is an SEO one, and it is what makes teams roll SSR back.

4. Hydration mismatches. When server HTML does not match what the client renders, Vue attempts to recover automatically, discarding incorrect nodes and mounting new ones at a rendering-performance cost. That cost lands on the Core Web Vitals you are also measured on. The documented causes are invalid HTML nesting, random values and time-zone differences. Vue 3.5 and later can suppress unavoidable mismatches with data-allow-mismatch; use it for the timestamp, not the article body.

5. Teleported content that is not in the response. Vue notes that the teleported content will not be part of the rendered string unless you inject it yourself. Fine for a modal. Not fine if a teleport carries anything you want indexed.

6. Custom directives, ignored. Most custom directives manipulate the DOM directly and are skipped during SSR. If a directive adds an attribute you care about, implement getSSRProps so the attribute reaches the server output.

Verifying it actually worked

Vue SEO fixes are easy to believe in without testing, because the app looks correct in the browser either way. Three checks, in this order.

The raw fetch. curl the route with no browser and read the response. The H1, body copy, route-specific title, meta description, canonical and JSON-LD should all be there. This doubles as the AI-crawler check.

The status-code sweep. Request a URL you know does not exist and read the status line, not the page:

curl -sI https://example.com/this-does-not-exist | head -1

A 200 here means the HTML5-mode fallback is producing soft 404s. This is the check nobody runs, and on a Vue SPA it is the one most likely to fail.

Google’s URL Inspection tool. Test the live URL in Search Console and open View tested page, which shows the rendered screenshot, the raw HTML returned and the HTTP headers. That is Googlebot’s own view. Anything in your browser’s DOM but missing here is arriving too late.

Run all three after any change to rendering or routing. The failure mode of Vue SSR is silent: the app keeps working in the browser whether or not the server produces useful HTML, and a route that fell back to client rendering during a refactor will not announce itself. If pages are fetched but not indexed after these changes, the diagnosis continues in crawled – currently not indexed.

Automate the checks from your route table

Manual checks decay. The route table changes every sprint, and the curl you ran in March says nothing about the route someone added in June. The fix is to let the router’s own route list drive the checks in CI, so every public route is tested on every deploy and a regression fails the build rather than a ranking.

The route table already knows which paths exist and, if you followed section 3, which ones should be indexed. A short script against a preview deployment covers the raw-HTML, title and status checks above:

// scripts/check-routes.mjs: run in CI against a preview deployment
import { routes } from '../src/router/routes.js'

const BASE = process.env.PREVIEW_URL
const paths = routes
  .filter((r) => r.meta?.index !== false && !r.path.includes(':'))
  .map((r) => r.path)

const failures = []
const titles = new Map()

for (const path of paths) {
  const res = await fetch(BASE + path, { headers: { 'user-agent': 'GPTBot' } })
  const html = await res.text()
  const title = html.split('<title>')[1]?.split('</title>')[0] ?? ''
  if (res.status !== 200) failures.push(`${path}: status ${res.status}`)
  if (!html.toLowerCase().includes('<h1')) failures.push(`${path}: no h1 in raw HTML`)
  if (titles.has(title)) failures.push(`${path}: same title as ${titles.get(title)}`)
  titles.set(title, path)
}

const missing = await fetch(BASE + '/this-route-does-not-exist')
if (missing.status !== 404) failures.push(`unknown URL returned ${missing.status}`)

if (failures.length) {
  console.error(failures.join('\n'))
  process.exit(1)
}

Dynamic routes such as /blog/:slug need their real paths from the same data source your build or sitemap uses. The same list is also the right input for generating the sitemap, so the sitemap and the router cannot drift apart.

Where does an AI model fit? Drafting titles and meta descriptions for new routes, for a person to approve, is a reasonable job for one. Deciding whether a route is indexable, or whether a missing page returns the right status, is not: those are deterministic checks and should stay deterministic. Keep generation and verification as separate layers. That is the same principle behind the rest of my SEO automation work, and building that kind of pipeline into a team’s own stack is what AI tools and automation engagements cover.

Where Vue SEO fits

This is one part of a series. The general mechanics, including Google’s deferred rendering and why AI crawlers behave differently, are in the JavaScript SEO guide linked at the top. The sibling instalments take the same decisions into other stacks: React SEO and Nuxt SEO for the Vue meta-framework, and the SEO for engineers pillar sits above them.

If you would rather have the rendering and routing strategy designed and shipped than retrofitted under deadline, that is part of what I do: the GEO and technical SEO audit covers the crawl and citation layers, and full-stack development covers building the decision into the codebase.

FAQ

How do I optimize Vue Router for SEO?

Start with the settings that change what a crawler receives. Use createWebHistory() instead of hash mode. Make every navigation a RouterLink or a real <a href>. Store each route’s title, description and indexability in route meta and render them on the server. Pick one trailing-slash and case policy with strict and sensitive, and 301 the variants at the server. Return real 404s, and lazy-load route components. Vue Router optimization for SEO only pays off once the routes that need to rank are prerendered or server-rendered.

Is Vue.js bad for SEO?

No, but Vue’s default output is a weak starting point. Vue renders in the browser by default, and its docs note that while Google and Bing index synchronous JavaScript applications, a crawler “will not wait for you to finish” when content is fetched after a loading state. Almost every real Vue app fetches asynchronously, so an unconfigured Vue app is a weak SEO starting point. The fix is a rendering-mode decision, not a migration away from Vue.

Does Vue need SSR for SEO?

Often not. Vue’s own guidance is that if you only want SSR for the SEO of a handful of marketing pages, you probably want static site generation instead. It produces the same crawler-visible HTML, deploys to any static host and needs no Node server. Reserve SSR for routes whose content varies per request, such as search results or live pricing.

Is hash mode bad for SEO in vue-router?

Yes, and vue-router says so: of createWebHashHistory() its docs state, “It does however have a bad impact in SEO.” The fragment is never sent to the server, so every hash route collapses to one URL, and Google generally does not support fragments that change page content. If the app is public, switch to HTML5 history mode before anything else.

Should Vue routes use a trailing slash?

Either form works; mixing them does not. Vue Router matches both by default, so /pricing and /pricing/ both return a 200, and Google treats them as separate URLs. Choose one, set strict: true on the router, 301 the other form at the server or CDN, and make canonicals and internal links use the same form.

Why do all my Vue pages show the same title in Google?

Because the per-route titles are set in the browser after the crawler has read the response. The static <title> in index.html is what a non-rendering crawler gets for every route unless that route is prerendered or server-rendered. A router.afterEach that sets document.title has the same problem. Move the affected routes to SSG or SSR and render the title from route meta through your head manager.

Why does my Vue SPA return 200 for pages that do not exist?

Because HTML5 history mode needs a catch-all server rule that serves index.html for anything unmatched, so the server never reports a 404. A NotFound route fixes what the human sees but not the status code. With SSR, match the URL with the router on the server and return a real 404. On a static host, configure a hosting-level 404. On a pure SPA, redirect to a URL that returns 404 or add noindex to the error view.

Will Googlebot render my Vue app anyway?

Usually, eventually. Googlebot renders JavaScript in a deferred step, so a client-rendered Vue route can be indexed late or partially. Two things make relying on that a poor plan: rendering is queued, not immediate, and the major AI crawlers do not render JavaScript at all. To them a client-rendered route is invisible, not merely delayed.

Do hydration mismatches hurt SEO?

Not directly. Google indexes the server HTML, and Vue recovers from mismatches automatically. The indirect cost is real: recovery discards incorrect nodes and mounts new ones, which is browser work at the moment Core Web Vitals are sampled. Treat mismatches as a performance defect, fix the documented causes (invalid nesting, random values, time-zone differences), and keep data-allow-mismatch for the cases that are truly unavoidable.